2018-01-17 08:37 AM
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
2018-01-17 09:00 AM
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.
2018-01-18 12:02 AM
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 = 31KRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K}2018-05-25 03:43 AM
Anyone can confirm that?