Trouble flashing firmware

Post here to get support
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Trouble flashing firmware

Post by marcus »

Did you get the same error on Windows 8? Did you manage to install the driver?

Do you have access to a Windows 7/XP or a Linux machine?
koolatron
Beginner
Posts: 3
Joined: Sat Jun 01, 2013 5:08 am

Re: Trouble flashing firmware

Post by koolatron »

I accidentally bricked my crazyradio by flashing it with the wrong firmware. So sad!

After a few days of hacking, though, I've created a Bus Pirate script that will program a crazyradio (or any NRF24LU1+ device) over SPI. You can use this as an emergency recovery if you don't have the JTAG dongle that our friends at bitcraze use for their development.

https://github.com/koolatron/buspirate_nrf24lu1p

Couple of caveats:
- Tested only on OS X. Should work on Linux without modification, and Windows with very minor changes to use the windows serial module.
- It's very slow (~5 minutes to flash the entire .bin file). I deemed this acceptable as this script is for emergency recovery only. I can make it faster if necessary.

Prerequisites:
- A Bus Pirate (you should know where to get one of these, if you don't already have one).
- perl and either Device::SerialPort (*nix) or Win32::SerialPort (Windows)
- Some jumper wires to connect the SPI lines on the radio to the ones on the Bus Pirate.

Instructions:
- Solder a 2x5 pin header onto the programming port of the crazyradio. There's an unpopulated footprint already there for you.
- Connect the crazyradio to your Bus Pirate using the table in the script. Also in the readme when I get around to sticking it on github.
- Run the script: perl ./flasher.pl -input ./cradio-0.51.bin -device [serial device]
- Wait till you see lots of hex addresses crawling up your screen. Your device is programming.
- Go make a sandwich or have a beer (or both).

I'll whack together some better instructions at some point...
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Trouble flashing firmware

Post by arnaud »

Thank you for this script, this is very useful! I will test it right away.

Actually I discovered that writing "0x02 0x78 0x00" at the beginning of the flash is enough to unbrick the Crazyradio (it forces it to jump to the USB bootloader), this could solve the speed issue. To generate this 'jump bootloader' firmware run in a console (on linux and OSX):

Code: Select all

echo -ne "\x02\x78\x00" > jmpBootloader.bin
Post Reply