[SOLVED] Can't flash custom built firmware to Crazyflie 1.0

Post here to get support
Post Reply
Shadyrou
Beginner
Posts: 3
Joined: Tue Jan 13, 2015 4:11 pm

[SOLVED] Can't flash custom built firmware to Crazyflie 1.0

Post by Shadyrou »

Hey all,

I have had the Crazyflie for about a week now and have been having fun with programming my own custom clients and playing around with the Crazyflie's capabilities. I have come to the point where I would like to edit the firmware to log some data from a proximity sensor that I have soldered and attached to the copter. I figured I would build the firmware on the Bitcraze VM first, flash the CF, and work on my alterations later. The build succeeded with no errors, and so did the flashing via the client bootloader, but upon restarting the CF in firmware mode, it simply had the blue power light and wouldn't otherwise respond. I flashed the 2014.01.0 bin the same way and it worked again.

Here is what I have tried on both Bitcraze VM 0.6 and Bitcraze VM 0.5:
- Building the crazyflie-firmware project via terminal with "make DEBUG=0 CLOAD=1" .
- Building the crazyflie-firmware project via Eclipse with target "Make CLOAD" (make DEBUG=0 CLOAD=1).
- Building the crazyflie-firmware project via Eclipse with target "Flash using radio". It successfully connects to the CF and says it flashes successfully, but still just a blue light.
- Downloading the latest source from github and building via "make DEBUG=0 CLOAD=1".
- Downloading the 2014.01.0 source from github and building via "make DEBUG=0 CLOAD=1"

I have tried flashing via client from both the VM and Windows. I should also note that all of my bin files end up being 76.1 KB. This doesn't seem correct, as the bin I downloaded (and the only one I have that works) is 54 KB.

Any assistance that you could offer would be much appreciated.

Thanks!
Last edited by Shadyrou on Wed Jan 14, 2015 8:42 pm, edited 1 time in total.
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Can't flash custom built firmware to Crazyflie 1.0

Post by chad »

Hmmm... I've built firmware for CF1 a number of times on the 0.5 VM before I switched to a dev environment on my Mac and I don't recall I had any issue with the resulting binaries. I don't have a CF here at work so I'll have to double-check this later tonight when I get home.

Can you verify you are on the head of master branch in the git repository clone you have? (git branch) Is the code clean (i.e. no modifications) when you build?

I'll see if I can build a good binary for my CF1 on the Bitcraze 0.5 VM when I get home (5 or 6 hours from now) and post the md5 if it's a good build. Then we can try some more troubleshooting.
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.
Shadyrou
Beginner
Posts: 3
Joined: Tue Jan 13, 2015 4:11 pm

Re: Can't flash custom built firmware to Crazyflie 1.0

Post by Shadyrou »

chad wrote:Can you verify you are on the head of master branch in the git repository clone you have? (git branch) Is the code clean (i.e. no modifications) when you build?
I am fairly sure that was the case (the code was definitely clean at least), but I will try once more when I have time just to confirm. I will let you know how it turns out.

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

Re: Can't flash custom built firmware to Crazyflie 1.0

Post by chad »

Hey! I tried out a build with the 0.5 VM just as you did (make DEBUG=0 CLOAD=1) the cflie.bin flashed successfully to my Crazyflie 1.0.

The md5 checksum for cflie.bin is a965991f06081cf2aa4f72f3b4f1b531. This is the same md5 I got when I built it through my Mac dev environment (using gcc-arm-none-eabi-4_7-2013q1)

I tried to build on the 0.6 VM as well. It has a newer arm gcc (gcc-arm-none-eabi-4_9-2014q4) so the resulting cflie.bin is subtly different. The md5 for the one on 0.6 VM is: 6e3fc1c03cf6a17a4d227bf286b021b7. This is also the same on my Mac dev environment. I was able to flash this firmware successfully as well.

So, if your binaries do not have the same md5s as mine, the build is not correct. But if they do, the flash is failing.

I suspect the build might be bad. One thing that can happen is that you can end up building with the regular gcc rather than gcc-arm-none-eabi depending on whee things are in your path. That will appear to be a successful build but will not run the Crazyflie after it has been flashed. If that's the case for you, moving the gcc-arm-none-eabi path to the front of your PATH environment variable might help. In the VMs try:

Code: Select all

export PATH="/home/bitcraze/bin/gcc-arm-none-eabi/bin:${PATH}"
To get the md5 checksum (while in the crazyflie-frimware directory) do:

Code: Select all

md5sum cflie.bin
Let us know how it goes.

**Edit** The md5 checksums above are only valid for checkout 81af8005c5eaaeaa3d0aec93133e10111aa603b4.
Last edited by chad on Wed Jan 14, 2015 11:18 pm, edited 1 time in total.
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.
Shadyrou
Beginner
Posts: 3
Joined: Tue Jan 13, 2015 4:11 pm

Re: Can't flash custom built firmware to Crazyflie 1.0

Post by Shadyrou »

Sorry for the delay. I don't really understand why, but it worked this time (most likely PEBKAC :P). Thanks!

Here's what I ended up doing (Bitcraze VM 0.5):
1. Cloned the git repository via "git clone https://github.com/bitcraze/crazyflie-firmware.git"
2. Built via "make DEBUG=0 CLOAD=1"
3. Flashed via client bootloader.

Thanks again! Off to play with my ultrasonic sensor :)
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: [SOLVED] Can't flash custom built firmware to Crazyflie

Post by chad »

Great!
Shadyrou wrote:Thanks again! Off to play with my ultrasonic sensor
Awesome. Love to hear about how that works out!
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