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

nRF52 SDK11: How to manage Linker file?

Hello,

I have setup a development environment using Eclipse and GCC. This setup works nicely. Thanks!

devzone.nordicsemi.com/.../

I noticed different examples in the SDK11 also has difference Linker RAM settings. Should these settings be managed manually? Any advice would be appreciated! I am an analog guy, so far enjoying working with Nordic products!!

Best

FI

  • The linker script defines the available memory of your chip, so it will be different for a 16k or 32k RAM IC, etc. It must be configured depending on the IC version you use and also depends on the SoftDevice you use because some memory is reserved for it.

    Here is a linker script I use for my nRF51 (16k RAM, 256k FLASH with SoftDevice S110):

    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      /*
       * 256kB flash
       * S110 version 8.0.0 takes 96kB (0x18000 bytes) of flash, rest for app.
       */
      FLASH (rx) : ORIGIN = 0x0 + 96K, LENGTH = 256K - 96K
      
      /*
       * 16kB RAM, 8kB for the user
       * S110 version 8.0.0 takes 8kB (0x2000 bytes). Default value - dependent upon configured size
       * of the GATT Server Attribute Table, rest for the app.
       */
      RAM (rwx)  : ORIGIN = 0x20000000 + 8K, LENGTH = 16K - 8K
    }
    
    INCLUDE "gcc_nrf51_common.ld"
    

    I noticed different examples in the SDK11 also has difference Linker RAM settings. Should these settings be managed manually?

    Several linker scripts (ld files) are given by Nordic. They do not depends on the SDK you use, but only on the SoftDevice and IC version. You must configure manually the right linker script in the Linker settings.

    The memory (flash, ram) reserved by each versions of the SoftDevice can be found in the SoftDevice Specification. Search for APP_CODE_BASE and APP_RAM_BASE.

Related