Flash Memory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-10 10:02 PM
I'm aiming to store data persistently in flash memory on an STM32 microcontroller. I've created a struct to hold the data, but I'm facing challenges with:
- Data Erasure: The data gets erased after a while, likely due to sector erase cycles.
- Sector Boundaries: I understand that flash memory erases in sectors, and I'd like to avoid writing to the same sector repeatedly to improve flash lifespan. However, I'm unsure about the best approach to determine where to store the data to ensure persistence.
- What recommended strategies or libraries are available for wear leveling on STM32 microcontrollers to distribute writes across different sectors and prolong flash life?
- Is a log-structured approach suitable for frequently updated data stored in a struct? If so, can you provide guidance on implementing this technique efficiently?
- How can I determine the appropriate sector size for my application and calculate suitable addresses for storing my struct data, taking wear leveling into account?
- Are there any additional best practices or recommendations for ensuring persistent data storage in flash memory using structs on STM32 microcontrollers?
Solved! Go to Solution.
- Labels:
-
STM32F1 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-11 12:06 AM - edited ‎2024-05-11 12:07 AM
https://www.st.com/en/embedded-software/x-cube-eeprom.html
Older:
For more on this, see recent threads:
https://community.st.com/t5/stm32-mcus-products/store-values-in-internal-flash/m-p/666974
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-11 12:06 AM - edited ‎2024-05-11 12:07 AM
https://www.st.com/en/embedded-software/x-cube-eeprom.html
Older:
For more on this, see recent threads:
https://community.st.com/t5/stm32-mcus-products/store-values-in-internal-flash/m-p/666974
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-05-11 12:38 AM
And big struct is bad choice, minimum change require write full new struct.
For STMs without ECC on flash is optimal 16bit struct and 16bit marker or 24:8 for one word writes.
For ECC is limit to one write in ECC segment then is good use full segment ...
Too sector is on every MCU parsed differently. Most M0 have many little sectors, but M4 for example have
4x16k - 64k - 128kxN ...
