cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM emulation in FLASH with Nucleo STM32L432KC & Linker File

dliky2
Associate II

Hello all,

I'd like to use a portion of my FLASH memory to save four 16-bit preset values. I've read that some STM have several Flash Type Program such as byte, halfword, etc.

Unfortunately, it seems that the L432KC only authorizes double word type.Therefore how should I handle this situation?

Also is it mandatory to modify my linker file to protect the memory area I plan to use (the last memory page located at address 0x0803F800)? If so, would someone have an example for me to learn from?

Thanks a lot for your help,

Emmanuel

5 REPLIES 5
KnarfB
Principal III

How often do you plan to change those values in the product life? Are they all changed together or independently? It won't hurt to write a 16-bit value as a double-word with the 64-16 upper bits zero (or even a checksum/error correction code).

hth

KnarfB

Not mandatory, but will catch situations where your app code hits the ceiling.

Create and write a larger structure, or separate the words with a wider stride

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Not very often. It's a proof of concept of a digital FM tuner (I know it already exists but it is done in the framework of an embedded course). Thanks for your advice.

Understood.

Could you recommend an example of modified linker file available somewhere on the web for me to have a look at it?

Thanks for your advice.

MEMORY
{
...
  FLASH (rx)        : ORIGIN = 0x08000000, LENGTH = 256K - 2K
}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..