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

UNINIT section gets initialized

Hello,

We're writing software for a device where we need a bootloader-application system. We wan't to share some data between the bootloader and the application. This is done by creating a struct in a fixed memory section called GLOBAL_DATA. This section must not be initialized so we've declared it as UNINIT.

When we run the application and step throug the scatter file load code we see that this section is initialized to zero ?!?!?

This is our scatter file:

LR_IROM1 0x08000000 0x0000A000
{
        ER_IROM1 0x08000000 0x0000A000
        {
                *.o (RESET, +First)
                * (InRoot$$Sections)
                .ANY (+RO)
        }

        IRQ_TABLE 0x20000000 0x00000100                         {
                * (IRQ_TABLE, +First)
        }

        GLOBAL_DATA 0x20000100 UNINIT 0x00000020        {
                * (GLOBAL_DATA, +First)
        }

        RW_IRAM1 0x20000120 0x00004DD0          {
                .ANY (+RW +ZI)
        }
}

We use the MDK v3.20 for ARM with a Cortex-M3 processor and we use the microlib arm library.

The declaration of the struct is done as following:

SGlobalData  __attribute__((section("GLOBAL_DATA"))) g_sGlobalData;

Any idea why this is not working ?

Kind regards,

Erwin Steffens