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

Hi All,

I need to prevent initializacion of one variable. I readed the Keil documentation and this other old thread "http://www.keil.com/forum/11937/" but the variable stills initialized.

This is my scatter file:

LR_IROM1 0x08020000 0x00060000  {    ; load region size_region
  ER_IROM1 0x08020000 0x00060000  {  ; load address = execution address
   *.o (RESET, +First)
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  RW_IRAM1 0x20000000 UNINIT 0x00000040  { ;no init section
        *(RW_IRAM1, +First)
   }
  RW_IRAM2 0x20000040 0x0001FFC0  {       ;all other rw data
        .ANY(+RW +ZI)
  }
}

And this the variable initialization:

unsigned long __attribute__( ( section( "RW_IRAM1"),zero_init) ) NI_longVar;

But the variable stills initialized at zero... don't know why.
I'm using uVision 5.14 and CMSIS-RTOS.

Thanks