Firmware Update

Firmware/software/electronics/mechanics
Netap
Beginner
Posts: 1
Joined: Mon Dec 14, 2015 1:03 pm

Firmware Update

Post by Netap »

Hi,
I'm new to the crazyflie, i'm using the Crazyflie 1.0, i was trying to update the firmware, i ran the "Update all projects" script. then opened the eclipse ran the Make CLOAD make target, and then the flash using radio. the make finishes with "Reset in firmware mode...", but the crazyflie is stuck only with the blue led of the power on. i can't connect to the device with the cfclient and don't really know what to do.
any advice?
Thanks
Neta
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Firmware Update

Post by chad »

I think, if you run the "make cload" target in the Eclipse project, it will make the Crazyflie 2 firmware by default. To make Crazyflie 1 fw, you will need to edit the make cload target and add a parameter. First you will want to run the "clean" target to get rid of the CF2 binary and object files though. So, try the following:

1) Run "clean" target in Eclipse
2) Edit the "make cload" target and add "PLATFORM=CF1" after the "CLOAD=1"
3) Run the "make cload" target again, you should get cf1.bin, cf1.elf, etc...
4) Reflash with the cf1.bin file and your Crazyflie should restart in firmware mode again and be ready to go. :)
5) Fly!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
thessy
Beginner
Posts: 4
Joined: Mon Aug 26, 2013 6:18 am

Re: Firmware Update

Post by thessy »

Hi,

rediscovered my crazyflie 1.0 in the shelf, after a few flights I got this "Error when starting log config [Motors]: Block too large" (viewtopic.php?f=5&t=775) and tried to update the firmware.

No I have the same situation like Netap. Flashed successfully the crazyflie, but after powering it on the red and green led are shining shorter than 1 second and only the blue one stays on.

@chad: are you sure about necessity of configuring the makefile?! I'm working with the virtual machine 0.6 and under ~/projects there are several directories and I think 'crazyflie-firmware' is for 1.0. Same in eclipse in "Make Target" I also see 'crazyflie-firmware' and if running 'Make CLOAD' I would estimate that the firmware for 1.0 is build and flashed.

Any hint, how to fix this situation?

Regards
Thomas
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Firmware Update

Post by chad »

Hi thessy,

In late July 2015 the crazyflie-firmware on the master branch was merged to contain both firmware for Crazyflie 1 and Crazyflie 2. Now, by default, "make CLOAD" will build firmware for Crazyflie 2. You can verify this by running the "make CLOAD" target and looking at the output in the console. It will look like this:

Code: Select all

Crazyloader build!
   text	   data	    bss	    dec	    hex	filename
  85844	   1248	  29856	 116948	  1c8d4	cf2.elf
The "cf2.elf" in the "filename" column is the elf file for Crazyflie 2.

I think the confusion is that there is a new firmware repository for the Crazyflie 2's NRF chip. That's the one called crazyflie2-nrf-firmware. This is different than the STM32 firmware (which is the micro-controller unit of the Crazyflie).

If you run the "make CLOAD" target it will build the STM32 firmware (for CF2 by default) but it won't flash it for you. The "make CLOAD" target is equivalent to running "make all DEBUG=0 CLOAD=1" on the command line. If you want to flash the firmware you build with Eclipse, you need to run the "Flash using radio" target which is equivalent to running "make cload" on the command line. The Crazyradio bootloader will happily flash a Crazyflie 2 binary to your Crazyflie 1 but the end result will be that the Crazyflie will restart, nothing will happen, and the blue light will remain lit. It can't run the CF2 firmware.

To fix this and build for Crazyflie 1, you simply tell the "make CLOAD" target that you want Crazyflie 1 firmware by setting PLATFORM=CF1 variable before running make. This is equivalent to running "make all DEBUG=0 CLOAD=1 PLATFORM=CF1" on the command line. If you already built the Crazyflie 2 firmware though, you need to run the "clean" target to get rid of the CF2 objects or you'll get an error.

Now, if you are going to flash using the Crazyradio in Eclipse (i.e. "Flash using radio" target), you have to add the "PLATFORM=CF1" to that target as well or it will look for the cf2.bin file, which will not exist since you just built cf1.bin.

So, the net takeaway here is, if you are building and flashing for Crazyflie 1 using the VM 0.6 and Eclipse, you need to edit both the "make CLOAD" target and "Flash using radio" targets by adding "PLATFORM=CF1". Alternatively, you could just create copies of both those targets, edit the copies, and rename them to something indicative of being for Crazyflie 1.

I hope my longwinded explanations helps more than hinders!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
ahuber1
Beginner
Posts: 15
Joined: Thu Jan 09, 2014 8:19 am

Re: Firmware Update

Post by ahuber1 »

Hi

i still have the same problem when i try to create a firmware.
After flash the Crazyflie Nano (CF1).
I already used the paramters PLATFORM=CF1 in command line, config.mk and i also changed it directly in Makefile.
Everything without success.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Firmware Update

Post by chad »

ahuber1 wrote:Hi

i still have the same problem when i try to create a firmware.
After flash the Crazyflie Nano (CF1).
I already used the paramters PLATFORM=CF1 in command line, config.mk and i also changed it directly in Makefile.
Everything without success.
Hi @ ahuber1,
In my experience, when the CF starts up, nothing happens, and the blue LED lights, it's a problem with the firmware. A few questions for you:

1) Is your crazyflie-firmware repository up-to-date and on the "master" branch before you build?
2) Are you using the Bitcraze 0.6 VM, or your own dev environment? The version of the ARM toolchain is important.
3) Have you made any modifications to the firmware? If something compiles OK but results in a runtime error, it can prevent the firmware from running.

Regards!
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
ahuber1
Beginner
Posts: 15
Joined: Thu Jan 09, 2014 8:19 am

Re: Firmware Update

Post by ahuber1 »

Hi @ chad,

i used several things, and after visit your site and read your blog i was able to create a right firmware.
In my VM 0.6 i forgot to switch the to the right repository.
On my Mac i compile it without the right development environment.

Thanks
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Firmware Update

Post by chad »

ahuber1 wrote:Hi @ chad,

i used several things, and after visit your site and read your blog i was able to create a right firmware.
In my VM 0.6 i forgot to switch the to the right repository.
On my Mac i compile it without the right development environment.

Thanks
Great to hear it!! I'm glad my blog could help you out and that you're up and flying again.
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Firmware Update

Post by tobias »

We really like your blog as well @chad!
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Firmware Update

Post by chad »

tobias wrote:We really like your blog as well @chad!
Thank you! I'm happy to know you guys look at it too. Now I feel I'd better try harder to keep the quality, relevancy, and freshness up. :o
Crazyflier - my CF journal...
4x Crazyflie Nano (1.0) 10-DOF + NeoPixel Ring mod.
3x Crazyflie 2.0 + Qi Charger and LED Decks.
Raspberry Pi Ground Control.
Mac OS X Dev Environment.
Walkera Devo7e, ESky ET6I, PS3 and iOS Controllers.
Post Reply