Changing permanently Firmware parameters

Firmware/software/electronics/mechanics
Post Reply
bracco23
Beginner
Posts: 5
Joined: Tue Nov 08, 2016 9:35 am

Changing permanently Firmware parameters

Post by bracco23 »

Hello,

I was trying to change the controller gains of the on board attitude and rate controller, but I can't find a way to change it permanently without recompiling and flashing a new firmware.

I did it from the "Parameters" tab of the GUI, but when I reboot the Crazyflie I see the old parameters again. Is there a way to do it? I can see two options for now:

1) Changing them everytime I turn on the drone, using the python API or some other way to make it automatic. Works, I used to do like this but it's a little bit of a hack.

2) change the firmware and flash it again. Works, but I would not really like to mess with the firmware.

Is there a third way, which allows me to not hack it or flash it?
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Changing permanently Firmware parameters

Post by arnaud »

Hi,

You are correct, this is actually the two possibilities. People have usually recompiled there own firmware but it is not ideal for sure.

I have been looking at implementing persistent storage for parameters for a while now. I just added a ticket on github ahout it: https://github.com/bitcraze/crazyflie-f ... issues/201. The idea is to use the Crazyflie eeprom to store and recall parameters value. This would solve your problem.

I can start looking at the firmware implementation, do you think you can help for the GUI part? We need to define how it should look like, and if you feel like implementing it, it is even better ;-).
bracco23
Beginner
Posts: 5
Joined: Tue Nov 08, 2016 9:35 am

Re: Changing permanently Firmware parameters

Post by bracco23 »

Well, I suppose you want to keep the possibility to modify the value of the parameter in the RAM as it is now, and just add the permanent storage in the EEPROM for retrieval at startup and for storage of a single value as requested.

If that is the case, I think there is little to no modification required to the GUI, since from the user point of view the new feature is really related to the already implemented one to change Params in RAM.

What I think would be easy and usable is to add a button in the Param Tab to save the values in the EEPROM. You can also keep track of which value is been modified and ended up to be different to the one in the EEPROM and send the request only for those values.

Something like this:
paramtab2.png
When pressed the button in the bottom right corner, every value modified get sent to the EEPROM to be stored.

I'd fork the project and implement it myself, but I'm still working on my thesis so I don't have much time for it right now. (but if the firmware and lib part are implemented in the next month or so, I might give it a shot since I'll be surely done by the end of March :D)
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Changing permanently Firmware parameters

Post by arnaud »

I like the idea of keeping track of which value has been modified, it keeps the GUI implementation simple. We can add a new column with the status (unmodified, modified, stored), maybe with color code. I will try to look at it and implement the Crazyflie and protocol part.
Post Reply