I added a crc field to my firmware, and now the compiler/linker is generating data past the end of flash. Below is my scatter file, the line that uses the crc section and the last few lines of the hex file that gets generated. Is this a bug?
LR_IROM1 0x00004000 0x00008000 { ; load region size_region ER_IROM1 0x00004000 0x00007ffc { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) } ER_CRC 0x00007ffc FIXED 0x00008000 { *(app_crc) } RW_IRAM1 0x10000108 0x00001FE0 { ; RW data .ANY (+RW +ZI) } }
static const uint32_t g_appCRC_ __attribute__((used, section("app_crc"))) = 0x10000001;
:107FF0000000000000000000000000000100001070 :10800000006CDC0200000000000000000000000026 :108010000000000000000000000000000000000060 :108020000000000000000000000000000000000050 :04803000000000004C
The last number on the region description is the size, not the end address. I think you're telling the linker the region for CRC is 0x8000 bytes in size.
Same problem for your other regions although I'm not sure it would change how big the linker is trying to make the secions. It seems like there's some padding going on.
Andrew
Yep, dumb mistake on my part. Thanks for pointing it out.