LEGO Mindstorms NXT Unbricking
I had the fun experience of trying to unbrick my son’s NXT brick over the weekend. No matter what I tried, I couldn’t get the official software to re-flash the firmware. We tried on the PowerBook G4 that he uses, we tried on a Windows XP box that I have around for this kind of thing. Nothing.
Lucky for us, however, is that the NXT uses the Atmel AT91SAM7S256 Microcontroller, which happens to have a special mode called SAM-BA that can be used to re-flash the firmware. However, using the Windows tools that Atmel provides didn’t work for us. But the Linux ones did. Using Fedora 12 under VMWare, I was able to follow the instructions here to get the device up and running again. One caveat is in step 12, they say “make sure that the address is 0x100000 (1 + 6 zeros)”. If you count the zeros there, you’ll see it’s 1 + 5 zeros. 0x100000 is the correct address — I tried 0x1000000 a couple of times before realizing that the two addresses didn’t match.
So now my son has a working NXT brick again and I have a working Linux installation again.
EDIT: The instructions also say to answer yes when the sam-ba tool asks to unlock and lock flash sectors. You do not want to lock the flash sectors. If you do lock them, the device will appear to work fine until you attempt to load a program onto the device and then it will hang. This may only apply to the official firmware (I used 1.05) and the official Mindstorms software — I have not tried any other combinations.