Bricked flie .. howto recovert

Firmware/software/electronics/mechanics
Post Reply
phiamo
Member
Posts: 31
Joined: Wed May 08, 2013 11:44 am

Bricked flie .. howto recovert

Post by phiamo »

I was a bit enthusiastic and added some code to the crazyflie firmware and flashed it ... now its a brick ;)

Only the blue LED is goin on red/green flash for a milisec afterpoweron but nothing else...

Now i am wondering on howto recover from here, i assume i need a jtag adtapter board to connect my flie via usb and then i should be abled to recover it right?

Atm i dont have any jtag boards here, but some arduinos and so i will now try turning the arduino into a jtag cable ... e.g. http://hsb.wikidot.com/arduino-jtag-finder-workshop

But since i have no experience with jtag etc it would be nice if someone could describe how the jtag recovery would normally work with commercial adaptor.

any help would be appreciated ...
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Bricked flie .. howto recovert

Post by marcus »

Hi phiamo,

It's ok, you can still use the bootloader to flash firmware. The quick flashing of the green/red LED you see is the bootloader running. Just do a normal cold-boot like described here and it should come alive again. Try the stock firmware found here.

When the Crazyflie is powered on the first thing executed is the bootloader. At this point the client can connect and stop the boot sequence to upload/flash new firmware. If the bootloader is not stopped within 500ms (I think) the boot sequence continues and the "normal" firmware is started. When updating the firmware using the bootloader you are safe since the bootloader cannot overwrite itself. The only way to brick it is to flash firmware that will erase the first pages of the flash where the bootloader resides.

/Marcus
phiamo
Member
Posts: 31
Joined: Wed May 08, 2013 11:44 am

Re: Bricked flie .. howto recovert

Post by phiamo »

Oh wow, didnt try it, just closed the win after nothing happened ;)
back on ;) but since i would really love to see what i did wrong, i think i wont come around a jtag interface for debugging?
Or is there anyways a chance to somehow see anything that happens on the cflie ?

My code is compiling completely, i am just a real n00b to c and hw programming, so i assume i did somehting wrong ... probably some pointer things while using
DEBUG_PRINT in the firmware ... as far as i understood, this should result in a console output in the python gui?!
is there

already got a bit further:
https://github.com/zoobab/tjtag-arduino ... ematic.png
but howto connect it exactly here http://wiki.bitcraze.se/projects:crazyf ... :explained
but is there any jtag device you would recommend?
atomicdog
Expert
Posts: 105
Joined: Tue Mar 12, 2013 2:50 am
Location: San Diego

Re: Bricked flie .. howto recovert

Post by atomicdog »

Did you compile with make cload=1 or just make all?
I had a similar thing happen to me. I thought I bricked it but when making a binary file that can be bootloaded through the Crazyradio you need to do a make cload.
6-DOF CF | wireless xbox 360 controller
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Bricked flie .. howto recovert

Post by marcus »

We are lagging a bit on instructions on how to set up the debug environment. But the easiest is to wait a bit until we created the next version of the Bitcraze VM, it will include the debug environment (using openocd/gdb/eclipse) and it will all be pre-configured to work out-of-the-box with the Crazyflie.

The JTAG header that's in the box goes on the pins 1-10 on the expansion header seen here. Since there's no key in the header make sure to put pin 1 to pin 1 on the connector. Just be careful when soldering it not to short any of the pints (either to each other or anything around)!

To compile the firmware have a look at the dev page. It needs some more info but the basics on how to compile are there.

Any JTAG will do, but we are currently using the Bus Blaster from Dangerous Protoypes.

/Marcus
marcus
Bitcraze
Posts: 659
Joined: Mon Jan 28, 2013 7:02 pm
Location: Sweden
Contact:

Re: Bricked flie .. howto recovert

Post by marcus »

atomicdog wrote:Did you compile with make cload=1 or just make all?
I had a similar thing happen to me. I thought I bricked it but when making a binary file that can be bootloaded through the Crazyradio you need to do a make cload.
Good point. I've just pushed a changeset to make CLOAD=1 default since most people will probably use the bootloader to flash firmware.

/Marcus
phiamo
Member
Posts: 31
Joined: Wed May 08, 2013 11:44 am

Re: Bricked flie .. howto recovert

Post by phiamo »

Wonderful, worked out for me just found cload=1 two hour or so ago myself ;) reading the doc is a good start ;)

anyways i think i would love to see some output of what i did wrong, or smth, is there any chance to connect a debugger to the flie? or execute the program in a sandbox?

the setup you are talking about, is it suitable to do exactly that ?
thanks a lot anyways!
Post Reply