2023-08-23 05:22 AM
Hi,
I need to write a variable, like ID , for a new design.
This ID during the normal program execution the user can change in order to assing a new ID. In the next re-start this new ID must to be can read.
someone could me help to implement this function?
thank
2023-08-23 06:09 AM - edited 2023-08-23 06:12 AM
The STM32L010K8 has 256 bytes of EEPROM at address 0x08080000. That data is nonvolatile.
https://www.st.com/resource/en/datasheet/stm32l010k8.pdf
If that's not enough, dedicate a page of flash to store data. You'll need to erase it before you can write to it, but once written, the value will stay there until it's changed. Note that erasing a flash page takes a little bit, tens to hundreds of ms or so.
2023-08-23 10:16 PM
Hi,
Do you know where I can find a example of code to do?
2023-08-24 06:21 AM
uint8_t data * = (uint8_t data *) 0x08080000;
data[0] = 42;
data[1] = 102;
if (data[0] == 42) {
...
}
I imagine you use it as normal memory.