Manual placement of Uninitialise section in Scatter load

Note: This was originally posted on 13th August 2009 at http://forums.arm.com

I have added following line of code in source file.

[i]XXX.c
.....
const uint32 REG__attribute__((section("CONSTSEG")));
...
...
*****************************************************************[/i]


Respective entry section in scatter load file.

Scatter.cfg
......
PLACEMENT 0xF0100000 UNINIT 0x0000FFFF
    {
       * (CONSTSEG)
    }
....

*As per my understanding the contents of these registers are not initialized to zero during
application startup, because this is likely to change the state of your system. Marking
an execution region with the UNINIT attribute prevents ZI data in that region from being
zero initialized.

But during scatter loading process it initializes the value of  "REG" to 0.
Parents
  • Note: This was originally posted on 13th August 2009 at http://forums.arm.com

    const uint32 REG__attribute__((section("CONSTSEG")));


    This might not actually make REG end up in a ZI section. Try

    const uint32 REG__attribute__((section("CONSTSEG"), zero_init));

    PLACEMENT 0xF0100000 UNINIT 0x0000FFFF
    {
        * (+ZI, CONSTSEG)
    }

    Regards
    Marcus
Reply
  • Note: This was originally posted on 13th August 2009 at http://forums.arm.com

    const uint32 REG__attribute__((section("CONSTSEG")));


    This might not actually make REG end up in a ZI section. Try

    const uint32 REG__attribute__((section("CONSTSEG"), zero_init));

    PLACEMENT 0xF0100000 UNINIT 0x0000FFFF
    {
        * (+ZI, CONSTSEG)
    }

    Regards
    Marcus
Children
No data
More questions in this forum