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

Scanner code on the central side getting reset after random interval of time

Hello,

I am working on a scanner code, I have initialize my scanner with this parameters.

    m_scan_param.extended               = true;
    m_scan_param.report_incomplete_evts = 0;
    m_scan_param.active                 = 1;
    m_scan_param.filter_policy          = BLE_GAP_SCAN_FP_ACCEPT_ALL;
    m_scan_param.scan_phys              = BLE_GAP_PHY_CODED;
    m_scan_param.interval               = 300;
    m_scan_param.window                 = 300;
    m_scan_param.timeout                = MSEC_TO_UNITS(300, UNIT_10_MS); //in 10 ms units
    
    init_scan.connect_if_match          = false;
    init_scan.conn_cfg_tag              = APP_BLE_CONN_CFG_TAG;
    init_scan.p_scan_param              = &m_scan_param;
    init_scan.p_conn_param              = NULL;

and in nrf_ble_scan_init()

p_scan_ctx->scan_buffer.p_data = p_scan_ctx->scan_buffer_data;
p_scan_ctx->scan_buffer.len    = BLE_GAP_SCAN_BUFFER_EXTENDED_MIN;

It is getting reset once in the beginning like after 3s and then randomly after awhile. I checked the reason, about why the code is getting reset, using sd_power_reason_get(&reset_reason). The reason I got was 0x02 which is due to watchdog reset. I am not able to figure out exactly, how to remove this error. I tried enabling and disabling NRFX_WDT_ENABLED, the code got reset still. I am not able to identfy what is the reason for watchdog reset. Does scan parameters, or extending scanner range have any impact? And, in future to make it work, without reseting again what should be done or implemented?

Thanks

Related