cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L152RB EEPROM Confusion

kevin
Associate II
Posted on July 25, 2013 at 17:24

I have a couple questions about the onboard eeprom found in the STM32L152RB and similar devices. 

My first question has to do with erasing the memory.  CD00242299 (the flash programming application note) mentions a double-word EEPROM erase, but states that it can only be performed from SRAM.  Does this mean the code itself has to be written to SRAM, or just the value 0x00000000 that is being written to the register?

My second question is, is there any way to write more than a single word to the EEPROM at a time?  I am finding writes to be painfully slow and am looking for any way to speed up the operation.  The manual talks about half-page writes to program memory, but not the EEPROM.  Aren't they both just different banks of flash?  Is it because of the way the memories are addressed (EEPROM being byte-addressable or something)?

Just trying to wrap my head around the EEPROM.  Any insight would be great!  Thanks in advance.
1 REPLY 1
Posted on July 25, 2013 at 17:48

From RAM means all your code, vector table, including interrupt handlers if enabled, needs to have been copied to RAM, and executing from there.

As I recall the L1 has specific issues with regard to caching of flash lines and the prefetch process wrt to code execution. Check the errata.

In the other STM32 parts the process doesn't not require the PROG bit to be toggled for each word, although I'm not sure that represents a significant expense or not. The biggest driver is the supply voltage, and charge pump performance.

You should be able to write a burst of 32 words on aligned boundaries, to FLASH.

EEPROM is a different beast, you'll likely have to experiment yourself if no one with specific experience responds to your thread.

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