cancel
Showing results for 
Search instead for 
Did you mean: 

unlocking Data EEPROM on STM32L1xx

mmensch
Associate II
Posted on July 30, 2014 at 10:35

Hi,

to unlock data EEPROM on STM32 I need to write a sequence of two values to the FLASH_PEKEYR. Any failure in the sequence will permanently lock the EEPROM.

Now there are some questions:

- Do I need to disable interrupt during this sequence ie is there also a timing criteria?

- Is it wise to open EEPROM once at startup and check if it succeeded and then leave it open or is it better to only open it for write purposes and then lock it again?

Thanks

Martin

1 REPLY 1
Posted on July 30, 2014 at 17:01

Generally the reason to keep things locked (FLASH, EEPROM) is so that errant code or wild pointers don't corrupt the system.

The lock/unlock sequences, as I understand them, are localized to the specific register and the state information behind it. So provided you unlock them with a specific subroutine, and you don't use it under interrupt, and it's not re-entrant, then you shouldn't have a problem. Other unrelated interrupts shouldn't cause a problem either.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..