Hello,
I'm trying to use the linker to place objects in one of two memory ranges EEPROM1 and EEPROM2. In the MEMORY part of the linker command file they are defined as:
PAGE 2: /* EEPROM */
EEPROM1 : origin = 0x1000, length = 0x1B00
EEPROM2 : origin = 0x3000, length = 0x2000
In the SECTIONS part of the linker command file I use them as follows
eeprom : >> EEPROM1 | EEPROM2, PAGE = 2
The objects to be placed in section "eeprom" are all defined in one C file in the following way:
#pragma DATA_SECTION(foo,"eeprom")
char foo[10];
According to section 7.8.6 of spru513c.pdf I would expect the objects of section "eeprom" to be placed in EEPROM1 or EEPROM2 as long as there is enough space there. Unfortunately, when linking I get the error
run placement fails for object "eeprom", size 0x21c8 (page 2). Available
ranges:
EEPROM1 size: 0x1b00 unused: 0x1b00 max hole: 0x1b00
EEPROM2 size: 0x2000 unused: 0x2000 max hole: 0x2000
as soon as the size of section "eeprom" exceeds the size of EEPROM2.
I would appreciate any help on how to distribute the contents of section "eeprom" to EEPROM1 and EEPROM2.
Another option would be to define one memory range EEPROM starting at 0x1000 with length 0x4000. With only one memory range I would need a way to tell the linker not to use the address range from 0x1b00 to 0x2000. Any ideas on how to achieve this?
Regards
Johannes