This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RAM Banks (RAM retention)

How are the four RAM banks divided up in the nRF51822? Is it an even split of the 16K total RAM (i.e. 4K per block)?

Furthermore, can I expect strange results if I turn on RAM-retention for the 8K of RAM the SoftDevice uses?

Thanks :)

Parents
  • Thanks for the hints. Unfortunately I am not using Keil but instead gcc-arm.

    This is how you do it for GCC for those who are interested:

    1. Add the following to the linker script (in SECTIONS, before bss):

       .noinit (NOLOAD) :
    	{
    		*(.noinit*)
        } > RAM
    

    2. In your source code for each variable you want retained:

    static uint8_t varName __attribute__ ((section(".noinit")));

    That's it! Working perfectly :)

Reply
  • Thanks for the hints. Unfortunately I am not using Keil but instead gcc-arm.

    This is how you do it for GCC for those who are interested:

    1. Add the following to the linker script (in SECTIONS, before bss):

       .noinit (NOLOAD) :
    	{
    		*(.noinit*)
        } > RAM
    

    2. In your source code for each variable you want retained:

    static uint8_t varName __attribute__ ((section(".noinit")));

    That's it! Working perfectly :)

Children
No Data
Related