cancel
Showing results for 
Search instead for 
Did you mean: 

virtual EEPROM parameters

rcohe.1
Associate II

I am trying to implement a virtual EEPROM on an STM32G0B1

Some simple implementations exist but i rather use the formal ST as described in:

https://www.st.com/en/embedded-software/x-cube-eeprom.html#

My question, what are the guidelines for the START_PAGE_ADDRESS? how do i make sure this section will never be used by my code, causing un-expected behavior? It seems i am supposed to configure the highest flash memory address and hope it will never overlap with my code. Am i wrong?

3 REPLIES 3
Bubbles
ST Employee

Hi @rcohe.1​,

basically yes, but it's not matter of hoping. You design the system with boundaries you want. Take a look in your map file to see the code size.

Also, the STM32G0B1 is dual bank. If your code can fit into bank 1, it's ideal to use bank 2 for EEPROM emulation. This way there will be the best performance.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

>>how do i make sure this section will never be used by my code..

Put it at the end of the linear code space, and shrink the memory described to the linker so it doesn't portion it out to other usage. The linker will then complain it has run out of space before encroaching on the memory you're using for the faux-eeprom.

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

If i understand correctly, to save space i also need to calculate the exact space needed by the driver, since the driver requests the starting address and not the end and the driver takes the extra space.

The driver might be well written but not fully thought of. It does not minimize the space needed, does not consider overlapping the code and the issues it might cause and it is not portable.