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

Error when trying to place variable at end of flash

Hi,

I'm trying to place a variable at a specific address in flash and I'm getting the following error

.\obj\IRQ.axf: Error: L6406E: No space in execution regions with .ANY selector matching __dczerorl2.o(.text).
.\obj\IRQ.axf: Error: L6407E: Sections of aggregate size 0x5c bytes could not fit into .ANY selector(s).
.\obj\IRQ.axf: Error: L6224E: Could not place __dczerorl2.o(.text) in any Execution region.

The bit of code that I use is

unsigned long long flash_key1[1] __attribute__((section(".ARM.__at_0x3FFF0"))) = {0xFFFFFFFFFFFFFFFF};

The flash on the device starts at 0 and has a size of 0x40000 so that's not the issue.

After spending some time on it because I was sure I was able to place variables there before. I found another project that I have where it works. I managed to break it by commenting out all the global variables in the project that previously worked.

Having a look at the map file generated when I place my variable at a lower address in flash it seems that __dczerorl2.o is related to zerorunl2.c, but I cannot find that file on my machine.

../clib/../cmprslib/zerorunl2.c 0x00000000 Number 0 __dczerorl2.o ABSOLUTE

Could some Keil guru explain why having a variable outside of main and using it inside main, fixed the error?

Thank you,

alex

  • Thank you very much.
    That post you pointed me towards worked for me.

    I found that declaring the variable as a constant also fixes the issue.

    Thank you for pointing me towards the C library and unpacking of statics. I'll do some reading on that.

    Regards,

    Alex