Flash the firmware

Firmware/software/electronics/mechanics
Post Reply
jihuangcontrol
Beginner
Posts: 4
Joined: Sat Nov 19, 2016 7:58 pm

Flash the firmware

Post by jihuangcontrol »

Hello folks,

Need help here. I have been trying to flash the firmware. Here is my list:

Crazyflie 2.0
nRF51 debug adapter + cable
Crazyradio PA + antenna

Does it mean I can only flash the firmware using PA/radio? Is there any way I can connect the cable through USB? What else hardware/cable do I need to connect crazyflie with the computer using USB?

Thank you so much. It has been a steep learning curve for me.
2016-12-18_00001.jpg
2016-12-18_00011.jpg
2016-12-18_00004.jpg
2016-12-18_00003.jpg
2016-12-18_00002.jpg
kekeller
Beginner
Posts: 27
Joined: Wed Oct 05, 2016 3:44 pm

Re: Flash the firmware

Post by kekeller »

What does not work when flashing the firmware? What is your end goal?

Normal Flash
1. When drone is OFF but battery is connected, hold down power button until both blue LEDs start to blink
2. When LEDs are flashing use the radio to flash the firmware using

Code: Select all

make cload
Debugger
If you use a debugger you can flash the firmware using

Code: Select all

make flash
or a number of other options. This is not recommended as it can have some unwanted effects such as broken bootloader. Normally unless you are debugging it, you don't need this.

Strange state flash
Sometimes the system will get in a bad state due to a bad flash or some bad code :D
1. If the button is not working to enter the boot state HOLD the button pressed and connect the battery. This can be a bit tricky so I sometimes use a power supply and some external leads when I will be doing this a lot.
2. The blue LEDs will start to blink and then you can flash the code normally over the air.
jihuangcontrol
Beginner
Posts: 4
Joined: Sat Nov 19, 2016 7:58 pm

Re: Flash the firmware

Post by jihuangcontrol »

Hi kekeller,

Thank you for the detailed explanation. I have not got that far yet.

My 1st goal is to connect the laptop with Crazyflie using programming cable so that I can start to flash it. However, with the things in the photo, I can not figure out how to make the connection. I feel like I need to buy an additional cable to achieve this. The cable I need should at least have one USB male connector.

Would you mind sharing your hardware, and how you connect your computer with crazyflie?

Sorry for the dumb questions.
kekeller wrote:What does not work when flashing the firmware? What is your end goal? ...
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Flash the firmware

Post by arnaud »

To flash Crazyflie using SWD you will need an SWD addapter that is compatible with OpenOCD. We are using Stlink-V2 and it will work by default with "make flash" and "make openocd". It will connect on the ARM-JTAG connector: https://wiki.bitcraze.io/projects:crazy ... connectors

But as noted by kekeller, it would be useful to know what it you end goal, not only your first goal. We each have our habits but I for example almost never use the SWD cable. I use it only to work on very low level stuff like low level driver. For normal development the radio boorloader and the debug tools like log/param works fine (and it is wireless, which helps for a flying platform :-).
jihuangcontrol
Beginner
Posts: 4
Joined: Sat Nov 19, 2016 7:58 pm

Re: Flash the firmware

Post by jihuangcontrol »

Thank you very much, arnaud, for not only the information but also the insight.

My final goal is to test different control algorithms. For example, auto take off, auto landing.

Back to the discussion on flashing: I will try to flash it using radio PA.
arnaud wrote: But as noted by kekeller, it would be useful to know what it you end goal, not only your first goal. ...
jihuangcontrol
Beginner
Posts: 4
Joined: Sat Nov 19, 2016 7:58 pm

Re: Flash the firmware

Post by jihuangcontrol »

Thank you guys. I was able to flash the drone.
Post Reply