2022-03-24 02:20 AM
As said in the title, if I have some EEPROM content in my source code, when starting the debugging session these data are not loaded, only the flash part is.
I must add that I'm talking about real EEPROM inside a STM32L010 device, not external EEPROM (which needs an external loader, that is OK) nor EEPROM emulation in flash (which will be loaded as part of the flash, that is OK).
Also why does the debugging session uses a temporary .srec file instead of the already generated .elf file that has already all the information in it (and CubeProgrammer can use without any problem) ?
Best regards,
Kraal
2022-03-24 06:05 AM
What do you mean exactly? Do you want the EEPROM populated in the same way that the FLASH is populated when you program the chip? As in, it's a section within your linker script?
2022-03-24 06:13 AM
Hi,
Yes, as in a section in my linker script
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 16K
EEPROM (rx) : ORIGIN = 0x08080000, LENGTH = 128
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 2K
}
/* Further down in the script */
.eeprom :
{
KEEP (*(.eeprom*))
} >EEPROM
And in my C file
__attribute__((__section__(".eeprom"))) const uint16_t table[] = {/* here a table of values */};
As said, the generated ELF file has all the content in it.