Compiling and Flashing Firmware

Firmware/software/electronics/mechanics
Post Reply
Freddy
Beginner
Posts: 9
Joined: Tue Nov 26, 2013 10:33 pm

Compiling and Flashing Firmware

Post by Freddy »

I need some Crazyflie Firmware for Dummies assistance...

I am trying to change stabilizer.c for some experimentation and want to flash the new stabilizer.c into the crazyflie.

I have downloaded and install VMware Workstation 10, downloaded BitCraze VM 0.4.ova and imported it into VM. I have a xubuntu session with bitcraze wallpaper and some icons.

I have my modified stabilizer.c saved as a .txt file on my PC.

How do I go about getting it compiled and flashed into the CrazyFlie? :?: :?:

Thanks in advance!
Freddy
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Compiling and Flashing Firmware

Post by tobias »

A Crazyflie firmware for dummies would be great to have. We just have to find time to write it...

I would launch Eclipse from the virtual machine and modify/build it from there. It is the easiest. You can then either flash it from cfclient and the boatloader dialog or from the command line in the firmware project folder by writing

Code: Select all

make cload
Freddy
Beginner
Posts: 9
Joined: Tue Nov 26, 2013 10:33 pm

Re: Compiling and Flashing Firmware

Post by Freddy »

HHHEEELLLPPP!! :o

I need to get the original firmware back into my crazyflie and am having "technical difficulties".

What I have done so far (for better or for worse,etc) is:
Installed VMWare Workstation and imported the bitcraze VM 0.4 machine and got that running.
I copied stabilizer.c onto the desktop so I would have the original to come back to.
Modified the motor power functions so that M!,M2 and M3 were always zero (in the stabilizer.c in modules/src/)
Built the firmware using the commands at the bottom of the README file (make CLOAD=1 DEBUG=0 <from crazyflie-firmware dir)
I then used the cfclient in the virtual machine to flash the firmware. I tried to do the .elf file first, which didnt work, so then read some more of the help files and deciced to flash the .bin file, which did seem to work.
After much playing around and figuring I wasn't going to get this all to work and the crazyflie not wanting to talk to anything, I put the original stabilezer.c back where it belonged, rebuilt the code and flashed the .bin file to the crazyflie.
Thinking I would be back to the original firmware I fired up the cfclient in windows and configured my joystick.. and only M4 works (and only M4 power bar shows power).
I have tried for quite a few hours to work out what I have done wrong and how to reflash the original firmware back in, back have decided it is time to ask for help.
So HELP!! PLEASE!!

How can I reflash the original firmware back in? I am just re-downloading the original VM 0.4 as I figure that going back to that might be the only solution left?

Merry Xmas, Santa I want a new crazyflie!

Freddy
Freddy
Beginner
Posts: 9
Joined: Tue Nov 26, 2013 10:33 pm

Re: Compiling and Flashing Firmware

Post by Freddy »

WOOHOO!! :D :D

I worked out my own problem!!

I installed the downloaded VM and flashed the crazyflie, all good.

I backed up the .bin file and everything else to another directory, edited the stabilizer.c and backed up the edited code.
Flashed the edited code and that all works now too, YAY!!!

Now... to work out the logging thingey stuff :?
danhamilt1
Beginner
Posts: 13
Joined: Wed Jul 17, 2013 1:59 pm

Re: Compiling and Flashing Firmware

Post by danhamilt1 »

Hey, glad to hear you have figured it out! I would say to look into local branching with source control, will save all of your copying files etc and allows you to switch between versions of your code easily using tortoiseHG.
Post Reply