Skip to content

keep board_id data in IMCU flash when reflashing firmware

Currently the borad_id data is storen in the flash file system on the RP2040. This gets overwritten when re-flashing the firmware using PyMakr.

There are multiple ways to solve this:

The best is probably to move the board_id data out of the flash file system and onto an extra partition/a seperate section of the flash, that is not used be the micropython firmware. This would require to build the micropython base firmware ourselfs and maintain that build regularly if we want to get updates of micropython. As this gets necessary when we want to use ISR's in C for RS485 communication anyways, we might as well wait for that change.

Another option would be to read the data before re-flashing and writing it back after the fact. Unfortunatly PyMakr does not seem to offer hooks before/after the upload process. One could probably implement a VScode task, that does the trick. A user/developer would then need to make sure to only ever use the VScode task and never the PyMakr upload button.

Edited by joknob001