Merging CF1 and CF2 crazyflie-firmware

Firmware/software/electronics/mechanics
Post Reply
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Merging CF1 and CF2 crazyflie-firmware

Post by tobias »

Hi All,

We have done some work merging the Crazyflie Nano (1.0) and the Crazyflie 2.0 firmware together. The current status is that they have been merged and seem to work as expected. We have not yet done any extensive testing though.

The merge has been made so it is keeping the old structure as much as possible which should make rebasing and updating forks less painless. The future plan is not to keep it this way though as we want the firmware to be cleaner and easier to develop upon which will require some refactoring and new APIs. It will mean moving files around, renaming them, building new abstracting layers etc. So before we start doing this work it would be the least job if we received pull reqests etc. Also it might be worth mentioning that it will be mainly the DRIVERS and HAL files that will be affected.

So if you are developing on the crazyflie-firmware please merge in the changes from the bigmerge branch and give us feedback on how it turns out. A tip is to try it out on a local branch of your working branch first to see how it works out.

Also if you have any suggestions on how to organize things make sure to post it here!

Some notes about building it. Since a common Makefile is now used for both firmware one have to specify which one to build with "PLATFORM=CF1" or "PLATFORM=CF2". The binaries will be called cf1.bin and cf2.bin respectively. You can put this either in config.mk or specify it as a parameter to make e.g.

Code: Select all

make PLATFORM=CF2 CLOAD=1 DEBUG=0
The Crazyflie 2.0 build is currently the default one. Also when switching target platform make sure to do a clean before building the new one.
jmelo
Beginner
Posts: 4
Joined: Thu Apr 09, 2015 10:03 am

Re: Merging CF1 and CF2 crazyflie-firmware

Post by jmelo »

Hello Tobias,

I am new to this CrazyFlie thing, and I am having some doubts about how to update the firmware for my CF1, that I think it might be related with this CF1/CF2 merging of software.

What I wanted was to upload the firmware of the CF1 that I have to an up to date version. What I did was the following:
1. Download the CrazyFlie VM
2. Run the update-all-projects.sh script
3. Open Eclipse, and select Team->Switch to->master
4. Rebuild
5. Upload the new cflie.bin to the CrazyFlie using, on my native machine (and not the VM), using the bootloader of the cfclient (version: 2014.12.3-51-g2d27e82, which I think is the most up to date). Also, i am not sure if it matters, but my native machine is an Ubuntu 14.04 64 bits

The problem with it, and the reason I am giving all these details is that I cannot communicate properly with my CF1. Using the cfclient, I can scan for it and connect to it, I can use the bootloader for new and the Configure1.0 utility successfully, but other than that, I can't do anything else. I don't receive any of the logs. Also, when running the cfclient with the "-d debug" options, I can see the following never-ending message repeated over and over again (they never end)

DEBUG:cflib.crazyflie:We want to resend and the pattern is there
DEBUG:cflib.crazyflie:Resending for pattern (76, 1)

Also, I manage to disconnect "properly"

INFO:cflib.crazyflie:Callback->Disconnected from [radio://0/10/2M]
DEBUG:cfclient.ui.tabs.ExampleTab:Crazyflie disconnected from radio://0/10/2M
DEBUG:cflib.crazyflie:Resending for pattern (76, 1)


Any idea what is happening, and how I can solve it?

Thanks,
Jose
jmelo
Beginner
Posts: 4
Joined: Thu Apr 09, 2015 10:03 am

Re: Merging CF1 and CF2 crazyflie-firmware

Post by jmelo »

Hi again,

No need to answer my previous comment, and re-did everything again and, magically, everything is working as it is supposed to now. I think I just had some kind of very unlucky combination of successive mistakes (there were also some new updates download, so it might had had something to do with it).

For the record, here is how proceeded to compile and successfully update the firmware to the CF1:

1. Download the CrazyFlie VM
2. Run the update-all-projects.sh script
3. Build the project: make PLATFORM=CF1 CLOAD=1 DEBUG=1
4. Copy the binaries to my native machine (By the way, the binary created is just "cflie.bin", and not cf1.bin as you mentioned)
5. Upload the new cflie.bin to the CrazyFlie using, on my native machine (and not the VM), using the bootloader of the cfclient (version: 2014.12.3-51-g2d27e82, which I think is the most up to date). Also, i am not sure if it matters, but my native machine is an Ubuntu 14.04 64 bits
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Merging CF1 and CF2 crazyflie-firmware

Post by tobias »

Recently I merged all the changes on the bigmerge branch over to the master branch as we now think it is tested enough to make it the master one.

Therefore from now on all cf1 and cf2 development should be derived/forked from the master branch and the master branch with be the branch we will accept pull request to. Exiting, isn't it! :)
chad
Expert
Posts: 555
Joined: Sun Sep 28, 2014 12:54 am
Location: New York, USA
Contact:

Re: Merging CF1 and CF2 crazyflie-firmware

Post by chad »

This is great Tobias! As someone who hacks on both CF1 and CF2 I'm really happy about it. This merge makes that even easier!

Thanks for all the hard work on the merge!
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