I thought you said that there was a tiny amount of non-volatile memory outside the normal flash on the STM32 chips?
Sadly it's only nonvolatile if there's a battery connected - there's 64-80 bytes that survive a reset, but when power is disconnected it's gone.
maybe could it be just after the bootloader in flash page 0
Yes, for writing once that's definitely possible. It then gets dangerous trying to change the value though.
Nothing stops the value being written alongside the saved code though... I think that would probably still be fine? I could make sure reset() didn't clear the calibration data and then you'd be sorted.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Sadly it's only nonvolatile if there's a battery connected - there's 64-80 bytes that survive a reset, but when power is disconnected it's gone.
Yes, for writing once that's definitely possible. It then gets dangerous trying to change the value though.
Nothing stops the value being written alongside the saved code though... I think that would probably still be fine? I could make sure
reset()
didn't clear the calibration data and then you'd be sorted.