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

RAM management for multiple links count and data length

Hello,

I am trying to increase the Peripheral/Central_Link_count to 10 for each or 20 in total and NRF_SDH_BLE_GAP_DATA_LENGTH above 200

I am getting an error when compiling "region RAM overflowed with stack" when using the settings above, I adjusted the RAM,

But I am not sure if it is the same issue :https://devzone.nordicsemi.com/f/nordic-q-a/26448/nrf52832-maximum-number-of-central-links

I can't have more than 14 NRF_SDH_BLE_TOTAL_LINK_COUNT on my app

the latest SDK 15.2 is supposed to support 20 concurrents connections, is it possible?

Details: 

nRF52832

SDK15.2

it is a multi-role app

Regards

Parents
  • Hi,

    You should be able to have 20 links total, but not for all configurations of those links. The amount of RAM needed for the SoftDevice increases with number of links and with data length settings, among other options. This means depending on the amount of RAM available on the SoC you may hit a limit on the number of links. In short it is a trade-off where you must keep the total amount of buffer space needed for the links low enough.

    It would not be the issue that you are linking to, as that one was if you have more than 15 links as central, and you have "only" 10 central links.

    Regards,
    Terje

  • Hi Tesc,

    The issue I am facing is can't go over 13 links count, e.g  8 Peripheral / 6 Central or any combination over 13, If I go over 13 links count the sd_ble_enable returns NRF_ERROR_NO_MEM and giving a message to change the RAM amount used for the Softdevice and the Maximum RAM size for the application, after changing these values I am unable to build my project returning the error "region RAM overflowed with stack"  I am using gcc to compile my project,

    I need to enable more links, but I am not sure if there are limitations on the nRF52832 to be able to do it, also I am using nRF_crypto stuff on my application and I probably could use a lot of RAM too

    Uploader my memory map when I am able to compile my project using only 13 links count:

  • Hi,

    What values were indicated from the NRF_ERROR_NO_MEM message, and what RAM settings did you end up with then?

    The total amount of RAM depends on the nRF52832 IC revision. Either 32 kB or 64 kB. If that turns out not to be enough for the settings that you need for your connections then you may have to upgrade to using the nRF52840 instead, with 256 kB of RAM. But first let me know what are the SoftDevice RAM requirements for your given configuration, so I can do an assessment and tell you if I think it is feasible on the nRF52832.

    Regards,
    Terje

  • Hi tesc, I am pretty sure I am using the nRF52832 64kb RAM version (it is a nRF52 DK)

    for example, using Peripheral and Central Link count: each 8 and NRF_SDH_BLE_GAP_DATA_LENGTH 27-150

    I get the following message

    0> <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
     0> <warning> nrf_sdh_ble: Change the RAM start location from 0x20009470 to 0x2000AEB0.
     0> <warning> nrf_sdh_ble: Maximum RAM size for application is 0x5150.
     0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
     0> <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at Bluetooth_Init.cpp:128
    

    using the following RAM settings

      FLASH_SOFTDEVICE (RX) : ORIGIN = 0x00000000,  LENGTH = 0x00026000
      FLASH (rx)            : ORIGIN = 0x26000,     LENGTH = 0x5a000
      SRAM_SOFTDEVICE (RWX) : ORIGIN = 0x20000000,  LENGTH = 0x00009470
      RAM (rwx)             :  ORIGIN = 0x20009470, LENGTH = 0x6B90

    But If change the settings for the recommended for nrf_sdh_ble output I am unable to build my project getting this message: "region RAM overflowed with stack"  does it mean the device is out of RAM?

    if I see the memory map I posted before it looks like still there is around 20kb free RAM, it is confusing.

    How recommended is to follow the steps in this post? 5years old reducing the __HEAP_SIZE 

    devzone.nordicsemi.com/.../ld-region-ram-overflowed-with-stack

Reply
  • Hi tesc, I am pretty sure I am using the nRF52832 64kb RAM version (it is a nRF52 DK)

    for example, using Peripheral and Central Link count: each 8 and NRF_SDH_BLE_GAP_DATA_LENGTH 27-150

    I get the following message

    0> <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
     0> <warning> nrf_sdh_ble: Change the RAM start location from 0x20009470 to 0x2000AEB0.
     0> <warning> nrf_sdh_ble: Maximum RAM size for application is 0x5150.
     0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
     0> <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at Bluetooth_Init.cpp:128
    

    using the following RAM settings

      FLASH_SOFTDEVICE (RX) : ORIGIN = 0x00000000,  LENGTH = 0x00026000
      FLASH (rx)            : ORIGIN = 0x26000,     LENGTH = 0x5a000
      SRAM_SOFTDEVICE (RWX) : ORIGIN = 0x20000000,  LENGTH = 0x00009470
      RAM (rwx)             :  ORIGIN = 0x20009470, LENGTH = 0x6B90

    But If change the settings for the recommended for nrf_sdh_ble output I am unable to build my project getting this message: "region RAM overflowed with stack"  does it mean the device is out of RAM?

    if I see the memory map I posted before it looks like still there is around 20kb free RAM, it is confusing.

    How recommended is to follow the steps in this post? 5years old reducing the __HEAP_SIZE 

    devzone.nordicsemi.com/.../ld-region-ram-overflowed-with-stack

Children
Related