Skip to main content
rcohe.1
Associate
February 22, 2023
Question

virtual EEPROM parameters

  • February 22, 2023
  • 3 replies
  • 1625 views

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?

This topic has been closed for replies.

3 replies

Bubbles
ST Employee
February 24, 2023

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.
Tesla DeLorean
Guru
February 24, 2023

>>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 VenmoUp vote any posts that you find helpful, it shows what's working..
rcohe.1
rcohe.1Author
Associate
February 26, 2023

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.