cancel
Showing results for 
Search instead for 
Did you mean: 

EEPROM Emulation for the STM32 CubeF1

clonephone82
Associate III
Posted on January 17, 2018 at 17:37

Hi,

In the STM32Cube_FW_F1_V1.6.0 software package i found the EEPROM example. STM32Cube_FW_F1_V1.6.0\Projects\STM32F103RB-Nucleo\Applications\EEPROM

Can someone tell me how the flash reservation is handle here? How big is the EEPROM and where can I decide how many pages are used for that?

I do not know how the pages are handled so that the user code is not flashed into the EEPROM pages because when I looked at the linker script I do not found anything different to a standard linker file. For me it is strange why there isn´t any extra Memory Area reservation for the EEPROM or some other reservation over sections or so.

Many thanks

mathias

3 REPLIES 3
Posted on January 17, 2018 at 18:00

The F1 series has the advantage of uniform sector size, but this can be a different size depending on the class of device and overall FLASH size.

Normally the EEPROM emulation uses two sectors, and in the F1 case I'd expect them to be at the end of memory, where you'd shrink the region size in the linker script or scatter file to accommodate that and flag an overflow in cases your code foot-print got too large. Arguably you don't have to tell the linker anything, and the address is likely hard coded as a #define in one of the .H files associated with the project.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
clonephone82
Associate III
Posted on January 18, 2018 at 09:02

Okay no I found what you mean. 

/* EEPROM start address in Flash */

#define EEPROM_START_ADDRESS ((uint32_t)ADDR_FLASH_PAGE_32) /* EEPROM emulation start address */

#define ADDR_FLASH_PAGE_32    ((uint32_t)0x08008000) /* Base @ of Page 32, 1 Kbytes */

So when I am right that starts at 32kByte. So when my code is bigger than 32kByte everything crashes. So for me that is a bad example ... ST the linker file should be changed to:

/* Specify the memory areas */

MEMORY

{

FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 31K

RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K

}
clonephone82
Associate III
Posted on May 25, 2018 at 12:43

Anyone can confirm that?