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

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.
  • Note: This was originally posted on 14th August 2009 at http://forums.arm.com

    Hy Marcus,

    I'm facing problem while try to placing uninitialized variable manually in the RAM region for execution.
    And I don't want to initialize REG. But during scatter loading even I don't mention about ZI still it initialize it to 0.  

    I don know why ?

    BR,
    AD

    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
  • 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
  • Note: This was originally posted on 14th August 2009 at http://forums.arm.com

    I'm facing problem while try to placing uninitialized variable manually in the RAM region for execution.
    And I don't want to initialize REG. But during scatter loading even I don't mention about ZI still it initialize it to 0.

    How do you place it? Using an at-attribute? This will implicitly create a ZI region.

    Regards
    Marcus