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

nRF52840 - Unable to increase Peripheral link count to max (20)

Hi,

I'm trying to increase the NRF_SDH_BLE_PERIPHERAL_LINK_COUNT to max possible (20) in my project. When I first tried to do this the softdevice prompted me with this error:


<warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.
<warning> nrf_sdh_ble: Change the RAM start location from 0x20002A98 to 0x20015290.
<warning> nrf_sdh_ble: Maximum RAM size for application is 0x2AD70.
<error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.


After this I went into the settings for the project and changed 'RAM_SIZE' and 'RAM_START' under 'Linker' -> 'Segment Placement Macros' to the values that the Softdevice error displayed. When trying to run the project again the softdevice presents this error instead:

<error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
<error> app: Fatal error

This time there is no indication about changing the memory placement/size. However if I decrease the NRF_SDH_BLE_PERIPHERAL_LINK_COUNT to 16 instead, it works. But going over 16 causes the error shown above.

Is there anything else that restricts the number of Peripheral Links?

Here are the relevant defines from my sdk_config.h file:

/ <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 16
#endif

// <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
#endif

// <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count. 
// <i> Maximum number of total concurrent connections using the default configuration.

#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 16
#endif


Board: nRF52840 Preview DK - PCA10056, Rev : 0.12.0
Softdevice: 6.0.0

SDK: v15.0.0

Parents Reply Children
  • Hi Sigurd,

    Thanks for you answer.

    Lowering both NRF_SDH_BLE_GAP _DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 150 instead of 251/247 allowed me to increase the Peripheral link count to 20. Is there anyway to calculate these values instead of doing trial and error?

    Also, what consequences can it have on the application when lowering NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU? 

    Br,
    Anton






  • Hi,

    Is there anyway to calculate these values instead of doing trial and error?

    No. The SoftDevice will output the RAM requirements after you have configured it, and you need to do this by trail and error.

    Also, what consequences can it have on the application when lowering NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU? 

    The data length is the on-air packet size, and the MAX MTU parameter is the maximum length of an ATT packet. For a 1 to 1 connection, lowering these parameters could lead to a lower throughput. For a 20 link connection, it might actually be beneficial to have a 27 byte data length, since the event length could also be lower, giving the scheduler better time to handle the 20 links and prevent connection events from overlapping. For more information, see the page Suggested intervals and windows and Bluetooth Low Energy data throughput.

Related