Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

region RAM overflowed with stack Error when using 6 Central + 1 Peripheral Links on nRF52 with SDK14.2

Hi

I have my application running on nRF52 on SDK 11 (Softdevice S132 version 2.0). I am using 1 peripheral and 6 central links in my application. I am migrating the application to SDK14.2, Softdevice 5.0 and facing issue when using 6 Central links.

I get "region RAM overflowed with stack" error if I use 6 Central links. Application works fine with 3 central links but if I increase the number of central links and change the RAM addresses accordingly then I get the above error. Below are the macros I have set in sdk_config.h

1. NRF_SDH_BLE_CENTRAL_LINK_COUNT         6

2. NRF_SDH_BLE_PERIPHERAL_LINK_COUNT   1 

3. NRF_SDH_BLE_VS_UUID_COUNT                     3

In the linker file, I was giving around 48K of RAM to application in the older SDK for 6 central links. But with the new SDK, I can give only 40K RAM to application for 3 Central links. It doesn't let me compile for more then 3 links.

The application was working fine with the same configuration with the SDK11 and Softdevice 2.0. Has the Softdevice RAM usage increased from v2.0 to 5.0? Are there any configurations I can change to reduce this usage?

Parents
  • Hi,

     

    The softdevice can report back, based on your configuration, what the RAM requirements for your specific configuration is.

    You'll need to enable NRF_LOG in order to get this feedback in either RTT or UART form.

    Here's an example when I configure a total amount of 7 concurrent links in sdk_config.h:

    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1

    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 6

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 7

    And the RAM requirements for the softdevice is then printed out:

    ..
    0> <warning> nrf_sdh_ble: RAM starts at 0x20002788, can be adjusted to 0x20003F60.
    0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xC0A0.
    0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    0> <error> app: Fatal error

    S132 v2 configurations should be more-or-less equal in RAM consumption.

    If you're still running out of RAM, you should check the __HEAP_SIZE and set this to 0 (assuming that you do not use the heap ofcourse), as this might be configured to 8k depending on what compiler that you use.

    Best regards,

    Håkon

Reply
  • Hi,

     

    The softdevice can report back, based on your configuration, what the RAM requirements for your specific configuration is.

    You'll need to enable NRF_LOG in order to get this feedback in either RTT or UART form.

    Here's an example when I configure a total amount of 7 concurrent links in sdk_config.h:

    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1

    #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 6

    #define NRF_SDH_BLE_TOTAL_LINK_COUNT 7

    And the RAM requirements for the softdevice is then printed out:

    ..
    0> <warning> nrf_sdh_ble: RAM starts at 0x20002788, can be adjusted to 0x20003F60.
    0> <warning> nrf_sdh_ble: RAM size can be adjusted to 0xC0A0.
    0> <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
    0> <error> app: Fatal error

    S132 v2 configurations should be more-or-less equal in RAM consumption.

    If you're still running out of RAM, you should check the __HEAP_SIZE and set this to 0 (assuming that you do not use the heap ofcourse), as this might be configured to 8k depending on what compiler that you use.

    Best regards,

    Håkon

Children
No Data
Related