sd_ble_gap_adv_set_configure() returns NRF_ERROR_INVALID_PARAM

Hello,

I am recompiling a system from a nRF52832 to the nRF52840.

This is a BLE peripheral. I started with a working ble peripheral example so that I was able to start with the new sdk_config.h and project solutions (Segger) so I believe these are correct as I am able to compile and execute the code.

When the code runs I get an error code 7 (NRF_ERROR_INVALID_PARAM) returned from sd_ble_gap_adv_set_configure().

Here is my advertising_init():

 

/**@brief Function for initializing the Advertising functionality.
 */
static void advertising_init(void)
{
    uint32_t               err_code;
    ble_advertising_init_t init;

    memset(&init, 0, sizeof(init));

    init.advdata.name_type          = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance = false;
    init.advdata.flags              = BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE;

    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_uuids;

    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;
    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
    SEGGER_RTT_printf(0,"ADV INIT: Num SYSTEM UUIDS:%x\n",init.srdata.uuids_complete.uuid_cnt);
}

My error occurs here:

At the point of error above, p_advertising is as follows:

Any help would be greatly appreciated!

Parents Reply
  • That worked and thank you for getting back to me quickly.!

    My project is rather large. I have over 8 services with as many as 30 characteristics in a service.  I appreciate your links back to the soft-device document that you supply with your answers. Quite often "experts" don't take the time to provide supplementary information (not referring to this forum). This forum is great. 

Children
No Data
Related