Context
The STeaMi board needs persistent configuration that survives power cycles. Initially, calibration values were stored in RAM and lost on reboot.
The config zone is a 1 KB area in the STM32F103 internal flash (gap between bootloader and interface firmware at 0x0800BC00). It survives interface firmware updates and clear_flash operations.
Flash layout
0x08000000 - 0x0800BBFF : Bootloader (47 KB, never touched)
0x0800BC00 - 0x0800BFFF : Config zone (1 KB)
0x0800C000 - 0x0801FBFF : Interface firmware (79 KB)
0x0801FC00 - 0x0801FFFF : DAPLink settings (1 KB)
Implemented usages
| Usage |
JSON key |
Status |
| Board revision |
rev |
Done (#169) |
| Board name |
name |
Done (#169) |
| Temperature calibration |
tc |
Done (#168) |
| Magnetometer calibration |
cal_mag |
Done (#170) |
| Accelerometer calibration |
cal_accel |
Done (#171) |
| Boot counter |
boot_count |
Done (#172) |
API overview
from steami_config import SteamiConfig
from daplink_flash import DaplinkFlash
config = SteamiConfig(DaplinkFlash(I2C(1)))
config.load()
# Board info
config.board_revision # -> 3
config.board_name # -> "STeaMi-01"
# Temperature calibration
config.set_temperature_calibration("hts221", gain=1.0, offset=-0.5)
config.get_temperature_calibration("hts221") # -> {"gain": 1.0, "offset": -0.5}
config.apply_temperature_calibration(hts221_instance)
config.save()
Dependencies
Sub-issues
All sub-issues are now closed and the steami_config module is shipped with examples for each use case (show_config, populate_demo_config, calibrate_temperature, calibrate_magnetometer, calibrate_accelerometer, boot_counter).
Context
The STeaMi board needs persistent configuration that survives power cycles. Initially, calibration values were stored in RAM and lost on reboot.
The config zone is a 1 KB area in the STM32F103 internal flash (gap between bootloader and interface firmware at
0x0800BC00). It survives interface firmware updates andclear_flashoperations.Flash layout
Implemented usages
revnametccal_magcal_accelboot_countAPI overview
Dependencies
Sub-issues
All sub-issues are now closed and the
steami_configmodule is shipped with examples for each use case (show_config,populate_demo_config,calibrate_temperature,calibrate_magnetometer,calibrate_accelerometer,boot_counter).