cancel
Showing results for 
Search instead for 
Did you mean: 

Write variables into non-voaltive memory STM32L010K8T6TR

loopis80
Associate

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

3 REPLIES 3
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

Hi, 

Do you know where I can find a example of code to do?

 

TDK
Guru
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.

If you feel a post has answered your question, please click "Accept as Solution".