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

SRAM NoInit LPC Realview

Hi @all

In my LPC-2119 project I need few bytes of internal SRAM which are NOT initialised at boot time.

I added in uv3 - Options for target - Target - Read/Write Memory Areas two areas of RAM.
The first RAM1 from 0x40000000, size 0x3FE0
The second RAM2 from 0x40003FE0, size 0x20 , NoInit checked.

Than I wrote a module with 3 unsigned long variables and assigned in project workplace the RAM2 to this file.

This 3 variables must not be initialized through the startup code, but they are if the debugger stops at the first C statement in main. The code between startup.s and main cause initializing.

Has anybody an idea ... or solution?

Thanks a lot.

  • The setup of the memory areas are correct. In addition you need to the following things:

    1) Open the Options for File dialog for the C-source file where the variables are defined. Select RAM2 under Memory Assignment - Zero Initialized Data.

    2) Select the C/C++ tab in the same Options for File dialog. Under Misc Controls enter the following command: --bss-threshold=0
    This tells the compiler that the linker should do the zero initialization. uVision generates a linker scatter file where variables in the RAM2 region are not zero initialized (option UNINIT).