[nRF52833] NRF_ERROR_NO_MEM for sd_ble_gap_adv_start()

Hello Experts,

I am writing a code for nRF52833 using the SDK nRF5 version v16 using the Segger Embedded Studio as development environment.

In my code when sd_ble_gap_adv_start() is called, I get the error NRF_ERROR_NO_MEM.

i.e. SVCALL(SD_BLE_GAP_ADV_START, uint32_t, sd_ble_gap_adv_start(uint8_t adv_handle, uint8_t conn_cfg_tag));

/**@brief Function for starting advertising.
*/
static void advertising_start(void)
{
ret_code_t err_code;

err_code = sd_ble_gap_adv_start(m_adv_handle, APP_BLE_CONN_CFG_TAG);
APP_ERROR_CHECK(err_code);

err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
APP_ERROR_CHECK(err_code);
}

I have created the pca10100/s140 folder and modified the .emproject file.

Below are linker specifications

linker_section_placements_segments="FLASH RX 0x0 0x80000;RAM RWX 0x20000000 0x20000"

linker_section_placement_macros=
"FLASH_PH_START=0x0;
FLASH_PH_SIZE=0x80000;

RAM_PH_START=0x20000000;
RAM_PH_SIZE=0x20000;

FLASH_START=0x27000;
FLASH_SIZE=0x59000;

RAM_START=0x20002ae8;
RAM_SIZE=0x1d518"

Also I tried other values of RAM_START and RAM_SIZE from ble_app_hids_keyboard example but still the same error.

The project settings show the flash_placements.xml being used and the .emproject file values exported when seen through common settings 

Cannot understand what should be modified.

Thanks in advance for your support

Best Regards

AbhiAsh

  • The Debug Terminal shows the following output

    <info> app_timer: RTC: initialized.
    <info> app: ble_advertising_init() returned 0x0
    <info> app: Beacon example started.
    <error> app: ERROR 12292 [Unknown error code] at /home/lenovo/projects/nordic/SDK/nRF5SDK160098a08e2_modified/examples/ble_peripheral/ble_beacon_sync_sl/main.c:253
    PC at: 0x0002763B
    <error> app: End of error report

  • Hi Abhi, 
    Error 12292 = 0x3004 mean it's BLE_ERROR_INVALID_ADV_HANDLE not NRF_ERROR_NO_MEM.

    Please take a look at the documentation of sd_ble_gap_adv_start() and try to debug the 2 possible causes of the problem:

    @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied:
    * - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t.
    * - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set.

  • Thanks Hung for the reply.

    I am kind of new to this development environment.

    The handle was the problem. The previous handle is used for beacon while I am using advertisement module

    ret_code_t err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);

  • Hi Abhi, 
    Please clarify if you've solve the problem with the handle ? 
    Note that the Softdevice in nRF5 SDK can only do one set of advertising at a time. So you won't be able to advertise 2 sets at a time (in nRF5 SDK). 

    Also, please be aware that nRF5 SDK is deprecated since 2020. For new development it's strongly recommended to start with nRF Connect SDK. 

Related