-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameter saving functionality #19
Comments
Hi, @pavel-kirienko Could you maybe provide some additional guidance? @dominiho This is the flash based param storage I was referring to. |
I think you meant to tag @pavel-kirienko. |
Thanks, indeed! |
It's quite easy. Add the files to the project and make sure this condition handles your MCU correctly. Then use it like that: |
Cool, I'll see what I can do. Hopefully this isn't too critical and I can take my time on this. |
Just to be sure I'm going down the right path with this. So the px4esc uses ChibiOS so I can't just shove those files into the px4flow code as is. But I should be able to implement a similar structure using the functions defined in https://github.com/PX4/Flow/blob/master/lib/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash.h is this correct? |
Yes, you'll need to replace the calls specific to ChibiOS, which is easy to do. I think you only need to replace these:
I highly recommend you to stay away from STM32's SPL, it's virtually unusable. You can use https://github.com/pavel-kirienko/px4esc/blob/master/firmware/src/config/flash_storage.c if you provide needed register definitions, like https://github.com/ChibiOS/ChibiOS-RT/blob/stable_2.6.x/os/hal/platforms/STM32F1xx/stm32f10x.h#L916. |
@andre-nguyen Any news on this? 8). Seems like a popular feature request. |
Sadly no :( |
Hi guys, |
@jgoppert In case you're tired resetting parameters all the time - could be actually quite quick. |
Parameters are now saved automatically to flash when sent to PX4Flow. If no parameters are saved, it falls back to default parameters (as defined in settings.c) I moved the setting of the parameters from 'communication.c:handle_mavlink_message' to 'settings.c:set_global_data_param', since it concerns the settings and not the communcication. This allows to set parameters easily during runtime. Parameters are only saved if sent via mavlink, not if they are setted using 'set_global_data_param(..)'. We could also changed this... Added basic functions to write to flash memory ('flash.c')
If I recall correctly,
there isn't a driver written yet to use the on board eeprom (microchip 24FC128??) to be able to save parameters. I would be interested to try my hand at writing it now that I'm back from competition.
Any tips would be appreciated.
The text was updated successfully, but these errors were encountered: