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

linker issue

Hello,

I'm working on Cortex M0 and I have an issue with the linker ( linker v5.03 from KEIL 4.72a ).

I want the linker to place data in a given memory area except in a small sub-area.

So I used the EMPTY attribute like this:

LR_FLASH 0x00800000 0x8000
{ EMPTY 0x00806F00 EMPTY 0x530 { }

OTHER { *.o (*) }
}

But the linker places data from OTHER region in the EMPTY region.

I think I misunderstood the usage of EMPTY attribute.

Thanks for your help

Parents
  • If you plan to write data in there in the future, you better allocate an entire sector - not 0x530 bytes.
    If you fill your array with binary 0xF (1111111) in the binary, you will be able to write immediately without first erasing - the very first time. Watch out while updating your firmware in the field - allow the bootloader to skip this region so you don't erase intermittent data. I would recommend against leaving holes - I no longer use the Keil toolchain but I encountered a lot of "pleasantries" by the linker in the past under certain conditions.

Reply
  • If you plan to write data in there in the future, you better allocate an entire sector - not 0x530 bytes.
    If you fill your array with binary 0xF (1111111) in the binary, you will be able to write immediately without first erasing - the very first time. Watch out while updating your firmware in the field - allow the bootloader to skip this region so you don't erase intermittent data. I would recommend against leaving holes - I no longer use the Keil toolchain but I encountered a lot of "pleasantries" by the linker in the past under certain conditions.

Children
No data