Journey of replacing the CC3200 Chip

Hi there :slight_smile:

Quick intro to the whole situation:
I got a used Toniebox from ebay with “a minor fault” that the seller “didn’t have time to look into”.
Obviously the problem was bigger than claimed (so as a warning: never trust ebay sellers that have multiple boxes to sell. They’re professionals and know that a repair is not possible or too complicated).

Long story short: The box first seemed to work mostly fine, but just couldn’t get a stable wifi connection. The signal is super weak and I can barely connect to it during the initialisation when holding my phone directly to the bare pcb.
The initialisation didn’t go through and the box was not usable (since it couldn’t download a firmware update).

I got the UART connection soldered up and working, but even so couldn’t convince the box to at least work in offline mode.

Now I did the mad thing, bought a replacement cc3200 from Ali and (apparently) actually managed to solder it in in my first hotair job.


(yeah… that Kapton tape seems sus…)

Now the new problem is that I can’t seem to properly flash all backup files back to the new chip, although the UART connection seems to be generally ok.

What I tried:

  • “format_flash”, which seems to work

    what seems suspect is the flash size of 1024, since my original dump is 4096kb.

Could it be that the chip I have has a too small flash? :frowning:

The journey continues.
Writing the first post I noticed the flash size after the format_flash command being too small for my dump (1M vs 4M dump).

0xbadbee mentioned in the telegram group that there is a size option for the “format_flash” command, which I then found in the cc3200tool github
So in order to give the flash enough space to take in the whole dump, I set it to 4M with
image

Formatting to 4M seems to work:
image

But after flashing the complete flash dump with
image

and then trying to read the filesystem, I still get the same error as before with the 1M flash:

And it continues on :slight_smile:

Now I re-formated the flash again and instead chose to write the individual files with “write_all_files”.
This time I get a proper listing of all files without errors:

A potential problem I can already see though: the slashes aren’t correct.
So I fear I’ll either have to look into the cc3200tool code to correct the slashes there… or flash the files individually with the correct path format

Nevermind: the slashes don’t seem to be a problem and the box actually boots.

AND IT DOES HAVE A PROPER WIFI signal now!!

Now I have to figure out what to do about the MAC and ID, since that seems to have changed with the new chip now.

I’ll continue the journey another time :slight_smile:

The slashes seem to be a windows problem, which is a bug in the cc3200tool. By using linux you may fix that.

To set the mac address, you’ll have to create a /sys/macadd.bin with the binary representation of the mac address (just the bytes)

Be sure it correctly connects to the cloud. The box has a servicepack for the wifi chip you may need to install.
Some info about it here: Bricked my box? - #13 by 0xbadbee

Is there a reason to use the 1.4.0 service pack instead of 1.5.0?

It is the version that is shipped via OTA over the cloud. The 1.5.0 could also work.

I wanted to write a little write up of the process, but didn’t have the time yet.

So just as a short update:
The box actually works with the new chip (and a custom batterypack and DIY USB-C charger cable).
:slight_smile:

So in case of not working wifi with a cc3200 chip, there is actually hope :wink:

1 Like

Congrats to your successfull replacement. Maybe one can help me with one thing I don’t quite understand:
Why is it neccessary to rewrite the flash after replacing the chip? Isn’t the flash completely stored on the external flash IC?

No, there’s no external flash (other than the SD maybe…).
The firmware an all other files are stored directly on the main IC flash, which in this case is in the CC3200

There is (the orange marked one). But that does not mean that rewriting the flash only affects the flash-IC. Maybe something is written to the cc3200 directly by writing all the files back. Just curious.

oh, you’re right.
sorry, I somehow assumed, it was just the internal flash of the chip. Then I don’t know whether the external one is used and why it would be needed to be reflashed.
Maybe there’s some encryption going on that is tied to the chip or something.

Awesome work. Thanks for documenting this.
I am about to do the same. Wifi is not working anymore and seems I need a new CC3200R1.

Some questions to that:
I extracted the flash, but was not able to read_all_files, as the cc3200tool does not show me the filenames. Is there a way to extract all files from the flash file? When I extract single files it work, but how do I know all the filenames in the flash?
How did you manage the mac and id? just create the macadd.bin? Is this relevant for the cloud?
So in fact the sequence is: service pack → reflash all files → macadd.bin?

Thanks for your work.

I’m not at home for a while and my internet connection is not so great here, so I can’t browse around too much right now.

I think there was a thread or wiki entry somewhere that was about the flash files not having names and how to deal with that.

I realize I still didn’t have time for the write up and indeed already forgot the exact order of operations.

I think it shouldn’t matter to much, whether you do the service pack or flash your files first or add the macbin, since they all write to different regions and shouldn’t overwrite the other stuff.

You could use the toniebox with teddycloud without using the macbin, but if you want to also contact the official server, your mac address needs to match the known one for your certificate, otherwise it would be rejected.