Hi, I'm still studying the dRonin code base and I get a little lost while trying to figure out how the configurations are managed. In other words, what happened after you change some configurations in GCS and click save to board? And how the configurations are loaded while the MCU is powered up? Where can I find the relevant code (in firmware code)?
The data is stored in UAVObjects with the settings attribute set to true e.g. https://github.com/d-ronin/dRonin/blob/next/shared/uavobjectdefinition/actuatorsettings.xml, this attribute means they can be stored in flash. GCS tells the board to save objects using "ObjectPersistence" transactions (https://github.com/d-ronin/dRonin/blob/next/shared/uavobjectdefinition/objectpersistence.xml). They are saved in the "LogFS" (TauLabs/dRonin specific I believe), https://github.com/d-ronin/dRonin/blob/next/flight/UAVObjects/uavobjectmanager.c#L728 https://github.com/d-ronin/dRonin/blob/next/flight/PiOS/Common/pios_flashfs_logfs.c. This abstracts the actual flash chip away, which can be either the internal flash on the micro controller or (preferably) an external flash chip. The flash storage is partitioned into a number of partitions (e.g. settings, bootloader, firmware, logging, etc.), and some of these partitions are LogFS partitions (settings, logging). LogFS splits the partition into "files"(/slots), and a UAVO occupies one file/slot.
In other words, you can build uav objects storing the data you want; the uav object generator converts these to C structs; and a bunch of other layers take care of persistence, loading, telemetering, providing them to GCS, etc, automagically.
That makes sense to me now. Thank you very much.