Hi Paulina,
I've read all of those and I don't think any of them answer my question. Your last reference, the one on storing and retrieving calibration parameters, does touch on a topic I'm still puzzled by.
I think it'd help if there was a description of what is envisioned as a typical end product configuration. How did the designers anticipate these functions being used in production? What's provided, as far as I can tell, is a Windows utility for development purposes only that has some calibration functions and can load and store settings using NVM_SetBlockFlash().
Obviously this needs to be done on a per-board basis if the calibration is to be useful. Is it intended that the Windows app be used to perform calibration in production? The internal functioning of the app is not really documented publicly.
Mag calibration data is saved using SaveMagCalibrationToNVM(), which is only ever called by the serial command decoder. The first thing I'd have to do to use it is to implement NVM_SetBlockFlash() and make it work with my own configuration storage, which on this device is in external SPI flash. That means I also have to change CALIBRATION_NVM_ADDR to something meaningful, but there's no documentation given on how large the required block of flash is.
I can deduce that from the code - and in fact it looks like every calibration write function uses the same call to write 256 bytes to the same address - but any time I run into an oversight like that it tells me that I might not be on the same page as the designers. This is what I mean when I say it looks more like a reference implementation than a library. The API isn't operating at the level of abstraction I would expect for a library.
To take this back to something more concrete, say the sensor fusion user has a thousand devices to ship. For fast startup, they need stored calibration data (5.4.3). Is it expected that they will run the Windows app for each one, manually saving the calibration data using the menu options? Is it expected that the calibration would be done only once with a development board and then that data would be replicated with the firmware?
Is magnetic pre-calibration even useful when the product is being shipped around the world to be used in another locale? If the magnetometer calibration data IS loaded from NVM, does that prevent it from running the background calibration?
If it's not pre-calibrated and the device completes calibration, is it expected that the application firmware will somehow detect this and trigger a NVM write to save it? I don't see any mechanism provided for that. If stored data is important for fast startup, and calibration runs continuously during operation, then I would want some kind of notification that it's time to update the saved data, or at least that an update is ready.
Thanks,
Scott