stopping advertize after dfu

hi 

after success dfu operation the firmware start to run

then i am getting stuck write after err_code = sd_ble_gap_device_name_set(&sec_mode, new_name, DYNAMIC_NAME_LEN);

because i need to stop the advertizing after the DFU

if am am cancelling the if ()  and stopping anyway i am getting error 0x3004

what is the difference between running from start or from dfu?

how can i know if the advertize is running?

thank you

nati 

if (m_advertising_running) {
// Safe to stop or update advertising
bsp_board_led_off(LEDBUTTON_LED);
// Stop current advertising (safe even if not running)
err_code = sd_ble_gap_adv_stop(m_adv_handle);
if (err_code != NRF_SUCCESS && err_code != NRF_ERROR_INVALID_STATE)
{
APP_ERROR_CHECK(err_code);
}
}

GetDataUUID(new_manuf_data);
if(NumSent++ >= NumRec)
{
NumSent = 0;
MemAdr = 0x21000;
}
// ==== Set GAP device name ====
ble_gap_conn_sec_mode_t sec_mode;
BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

err_code = sd_ble_gap_device_name_set(&sec_mode, new_name, DYNAMIC_NAME_LEN);
APP_ERROR_CHECK(err_code);

Parents Reply Children
  • hi

    as far as i understand ,i am using it :

     uint8_t            m_adv_handle  = BLE_GAP_ADV_SET_HANDLE_NOT_SET;                           /**< Advertising handle used to identify an advertising set. */

    or if you mean somthing else please explain

    i am repeating my problem:

    DFU work perfect and .

    i have complete merge package with settings (secure boot loader ,application that works and software device + settings)

    the tag works

    when entering dfu with button if enters dfu i recognize if with your app and downloading new app the same one (packed in sip file like in the instruction) when it finish download the unit resets but when i am getting to  :

    err_code = sd_ble_gap_device_name_set(&sec_mode, new_name, DYNAMIC_NAME_LEN);
    APP_ERROR_CHECK(err_code);

    its not passing

    what can be the reason and how to debug it

    thank you

    nati 

Related