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

NRF_ERROR_NO_MEM after changing CENTRAL_LINK_COUNT

Dear Devzone,

I am working in the dynamic multiprotocol template project and want to add a BLE central connection. When I change the NRF_SDH_BLE_CENTRAL_LINK_COUNT & NRF_SDH_BLE_TOTAL_LINK_COUNT in sdk_config.h I get an error message about not enough memory.

<warning> nrf_sdh_ble: RAM starts at 0x20002748, can be adjusted to 0x200030C8.
<warning> nrf_sdh_ble: RAM size can be adjusted to 0x3CF38.
<error> nrf_sdh_ble: sd_ble_enable() returned NRF_ERROR_NO_MEM.
<error> app: ERROR 4 [NRF_ERROR_NO_MEM] at 
<error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\Github\STIWHN\nRF5_SDK_for_Thread\projects\multiprotocol\experimental\HetNet_openThread\main.c:853

I figured out how to change the RAM locations and size in SES using the common configuration. At the 'section placement macros' I change the values to what is proposed by the application.

But when I run the application then it still does not start and only gives me the error :

<error> app: ERROR 4 [NRF_ERROR_NO_MEM] at C:\Github\STIWHN\nRF5_SDK_for_Thread\projects\multiprotocol\experimental\HetNet_openThread\main.c:685

I do not get a proposed alteration for the RAM start or size. Once I change the NRF_SDH_BLE_CENTRAL_LINK_COUNT back to zero my project runs.

I tried using different counts from 1 to ... 8

Anyone had this before or has some idea how I could fix this ?

Thanks in advance

Parents
  • I have been able to retrace the error to the following functions. If and when I disable lbs_c_init(); (led button service client) my code does compile.

    lbs_c_init(); enables the led button service client:

    /**@brief LED Button collector initialization. */
    static void lbs_c_init(void)
    {
        ret_code_t       err_code;
        ble_lbs_c_init_t lbs_c_init_obj;
    
        lbs_c_init_obj.evt_handler = lbs_c_evt_handler;
    
        for (uint32_t i = 0; i < NRF_SDH_BLE_CENTRAL_LINK_COUNT; i++)
        {
            err_code = ble_lbs_c_init(&m_lbs_c[i], &lbs_c_init_obj);
            APP_ERROR_CHECK(err_code);
        }
    }
    

    It is the exact same code from the ble_app_multilink_central example. This code goes to the ble_lbs_c_init() function, which is from the lbs_c library: ble_lbs_c.c

    ble_lbs_c_init(); makes a call to sd_ble_uuid_vs_add(); which in turn calls a function in ble.h

    SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type));
    

    The return values for this function are as following:

     @retval ::NRF_SUCCESS Successfully added the Vendor Specific UUID.
     @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid.
     @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs.
    

    So there seems to be no free slots for VS UUID's. Why would I need to do this anyway?

    Can I just skip this part?

Reply
  • I have been able to retrace the error to the following functions. If and when I disable lbs_c_init(); (led button service client) my code does compile.

    lbs_c_init(); enables the led button service client:

    /**@brief LED Button collector initialization. */
    static void lbs_c_init(void)
    {
        ret_code_t       err_code;
        ble_lbs_c_init_t lbs_c_init_obj;
    
        lbs_c_init_obj.evt_handler = lbs_c_evt_handler;
    
        for (uint32_t i = 0; i < NRF_SDH_BLE_CENTRAL_LINK_COUNT; i++)
        {
            err_code = ble_lbs_c_init(&m_lbs_c[i], &lbs_c_init_obj);
            APP_ERROR_CHECK(err_code);
        }
    }
    

    It is the exact same code from the ble_app_multilink_central example. This code goes to the ble_lbs_c_init() function, which is from the lbs_c library: ble_lbs_c.c

    ble_lbs_c_init(); makes a call to sd_ble_uuid_vs_add(); which in turn calls a function in ble.h

    SVCALL(SD_BLE_UUID_VS_ADD, uint32_t, sd_ble_uuid_vs_add(ble_uuid128_t const *p_vs_uuid, uint8_t *p_uuid_type));
    

    The return values for this function are as following:

     @retval ::NRF_SUCCESS Successfully added the Vendor Specific UUID.
     @retval ::NRF_ERROR_INVALID_ADDR If p_vs_uuid or p_uuid_type is NULL or invalid.
     @retval ::NRF_ERROR_NO_MEM If there are no more free slots for VS UUIDs.
    

    So there seems to be no free slots for VS UUID's. Why would I need to do this anyway?

    Can I just skip this part?

Children
No Data
Related