gfroerli / firmware

Firmware for the water temperature sensor project
GNU General Public License v3.0
6 stars 1 forks source link

EEPROM based config #85

Closed dbrgn closed 3 years ago

dbrgn commented 3 years ago

My proposal would be to put the configuration variables (e.g. interval, encryption keys, etc) in EEPROM. We have 2x3 KiB of EEPROM, that should be plenty.

See diff for my proposed memory layout. If you agree, I can implement this.

The EEPROM can be read simply by reading the corresponding raw memory addresses. To write the EEPROM, we can use a custom binary based on probe-rs, which reads a TOML file with the config and writes to the target's EEPROM. Alternatively, instead of writing to the target directly, we could generate a binary file or hexfile and flash that to the target using cargo-embed.

(Support for flashing EEPROM is WIP.)

dbrgn commented 3 years ago

image