Write variables into non-voaltive memory STM32L010K8T6TR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-23 5: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
- Labels:
-
STM32L0 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-23 6:09 AM - edited ‎2023-08-23 6: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-23 10:16 PM
Hi,
Do you know where I can find a example of code to do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-24 6: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.
