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

Error for connecting more than 4 centrals to multiperipheral example code

Hello ,

I am using Multiperipheral example code , and i want to connect more than 4 central devices. I have edited  the link total value and number of peripherals and centrals in SDK_config file. I am getting following error:

<info> app: Multiperipheral example started.<CR><LF>

<info> app: Connection with link 0x4 established.<CR><LF>
<error> app: ERROR 18 [NRF_ERROR_CONN_COUNT] at :0<CR><LF>
PC at: 0x00000000<CR><LF>
<error> app: End of error report<CR><LF>
<warning> app: System reset<CR><LF>
<info> app: Multiperipheral example started.<CR><LF>

I am using S132 softdevice and SDK V15.2.0. I think there is memory mangement issue for more than 4 devices.How to adjust the memory  and increase the number of devices can connect.?

Please help me for getting this issue solved.

Thanks and regards.

Parents
  • Hi, 

    NRF_ERROR_CONN_COUNT means the Maximum connection count exceeded.

    Can you post the setting NRF_SDH_BLE_CENTRAL_LINK_COUNT / NRF_SDH_BLE_PERIPHERAL_LINK_COUNT / NRF_SDH_BLE_TOTAL_LINK_COUNT in sdk_config.h?

    -Amanda

  • Thanks for reply , Amanda.

    I have two cases which i got RAM data allocation error in first case and above mentioned error in second case.

    1) Case 1:Issue of RAM when the number of peripherals is made 5:


    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 5 // In sdk_config.h file

    Where i have ised this condition in main code:
    if (periph_link_cnt == NRF_SDH_BLE_PERIPHERAL_LINK_COUNT)
    {
    bsp_board_led_off(ADVERTISING_LED);
    }
    else
    {
    // Continue advertising. More connections can be established because the maximum link count has not been reached.
    advertising_start();
    }

    following errors i got in logs while executing code:
    <warning> nrf_sdh_ble: Insufficient RAM allocated for the SoftDevice.<CR><LF>
    <warning> nrf_sdh_ble: Change the RAM start location from 0x20003770 to 0x20003EA0.<CR><LF>
    <warning> nrf_sdh_ble: Maximum RAM size for application is 0x11558.<CR><LF>
    <error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.<CR><LF>
    <error> app: ERROR 4 [NRF_ERROR_NO_MEM] at :0<CR><LF>
    PC at: 0x00000000<CR><LF>
    <error> app: End of error report<CR><LF>
    <warning> app: System reset<CR><LF>


    2)Case 2:Issue occured when NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1 and NRF_SDH_BLE_CENTRAL_LINK_COUNT 4:

    #define LINK_TOTAL NRF_SDH_BLE_PERIPHERAL_LINK_COUNT + NRF_SDH_BLE_CENTRAL_LINK_COUNT
    Where i have ised this condition in main code:
    if (periph_link_cnt == LINK_TOTAL)
    {
    bsp_board_led_off(ADVERTISING_LED);
    }
    else
    {
    // Continue advertising. More connections can be established because the maximum link count has not been reached.
    advertising_start();
    }

    And i got this error which is already mentioned in my first query.

    Thanks and regards.
    -Sarika

  • Hi, 

    In case 1:

    This line indicates that your changes to the RAM start location weren't sufficient; 
    <warning> nrf_sdh_ble: Change the RAM start location from 0x20003770 to 0x20003EA0.<CR><LF>

     Did you try using the suggested 0x20003EA0?

    This post might help. 

    In case 2:

    You should modify in sdk_config.h as

    // <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 4
    #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 1
    #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 5
    #endif

    -Amanda

  • Thanks for the reply Amanda.

    I have tried the case 2 suggestion and getting the same error as error  for the case 1  .

    Can you please tell me how to change the RAM start location?

    Thanks and regards.

    -Sarika

Reply Children
Related