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

the way of reducing softdevice resource consumption

Hello,

in the new version of sdk (11.0.0) you support s130 only. That means the code contains both peripheral and central implementation. Does it mean that s130 consume more RAM resources than s110 and s120 separately? If so, how to reduce consumption of RAM?

  • Hi Gerbert,

    RAM usage of the SoftDevice in s130_nrf51_2.0.0-7.alpha is alreay reduced compared with s110_nrf51_8.0.0. Look at linker scripts.

    s110 on SDK 10.0.0:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x18000, LENGTH = 0x28000
      RAM (rwx) :  ORIGIN = 0x20002000, LENGTH = 0x6000
    }
    

    s130 on SDK 11.0.0-2.alpha:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20001f00, LENGTH = 0x6100
    }
    

    Although flash usage grew, now we have more RAM. :)

  • Really? Then how much does the s130 consume RAM in SDK 11.0.0? Please show me the values.

  • Hi Gerbert,

    It's correct that the minimum RAM required for the S130 actually lower than what was on the S110 or S120.

    The reason for that is that the RAM configured for S130 v2.x is configurable via the sd_ble_enable() function. This is because the number of central, peripheral and encrypted central link that you plan to handle is configurable.

    On earlier softdevice version was fixed, for example the S110 support 1 peripheral links, S120 support 8 central links, S130 v1.x support 3 central links and 1 peripheral link. On S130 v2.x this is flexible. So if you just want the functionality of S110, you can configure the S130 to support only 1 peripheral link, this way you won't waste RAM on the S130.

    Note 1: you can only save RAM, the flash size is fixed

    Note 2: To be able to configure the RAM correctly, you should start first with a dummy RAM configuration, such as ORIGIN = 0x20001f00, LENGTH = 0x6100, and put 0x20001f00 into the p_app_ram_base parameter. Then you run in debug mode and add a breakpoint at the function. After you call the function, you can check the p_app_ram_base again and see what is the actual RAM requirement for the setup you choose. After that you can update the RAM configuration in KEIL.

    We will publish a tutorial with more detail on how to do it soon.

  • $ grep RAM sdk_11.0.0/components/softdevice/s130/toolchain/armgcc/*.ld sdk_11.0.0/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxaa.ld: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000

    sdk_11.0.0/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51422_xxac.ld: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000

    sdk_11.0.0/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000

    sdk_11.0.0/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxab.ld: RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000

Related