This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Link Error, no enough space for ROM, but we do have enough space actually

I have a project and recently we add some more code and try to build we get following error

Error: L6406E: No space in execution regions with .ANY selector matching maybetermalloc1.o(.emb_text).
Error: L6407E: Sections of aggregate size 0x2c28 bytes could not fit into .ANY selector(s).

It looks like, We run out of ROM space but this is not true.

We have 1MB internal ROM. 64K allocate to Bootloader, 64K allocate to speical data. and leave about 913K for application.

here is the sct file setting.
APP_IROM1 APP1_ROM_BASE APP1_ROM_SIZE { ; load region size_region ER_IROM1 +0 APP1_ROM_SIZE { ; load address = execution address *.o(RESET, +First) *(InRoot$$Sections) * (.init_array) .ANY (+RO) }

APP1_ROM_SIZE = 0xE0000

After I change the Rom Size to 0xF0000, compiler stop complain. but when i check the Map file, it really confused me

Execution Region ER_IROM1 (Base: 0x01010000, Size: 0x000b2f3c, Max: 0x000f0000

Map file show the application only take about 0x000b2f3c (732K) space, but I don’t know why the compiler need 0xF0000 (983K) to compile it.

I test this build and i can see this build definlitly overwrite certain data over 0xF0000 space which is not expected .