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

nRF52840 DK restarts application after 3 minutes when not connected to any device via BLE

Hi. I have edited the Heart Rate Service Example project in SDK 17.02 and I am currently using nRF52840 DK.

I am not sure of the reason why the application restarts after 3 minutes when it is idle.

It does not restart when it is connected to nRF toolbox mobile app.

Is there a reason why?

I will appreciate the help.

Thank you.

Parents
  • Hi,

    the application advertising interval is 180 seconds (3 minutes). 

    #define APP_ADV_DURATION                    18000                                   /**< The advertising duration (180 seconds) in units of 10 milliseconds. */

    If the device wasn't connected within that period, the application enters the idle state ( adv event : BLE_ADV_EVT_IDLE ) in which it enters the deep sleep mode.

    static void on_adv_evt(ble_adv_evt_t ble_adv_evt)
    {
        ret_code_t err_code;
    
        switch (ble_adv_evt)
        {
            case BLE_ADV_EVT_FAST:
                NRF_LOG_INFO("Fast advertising.");
                err_code = bsp_indication_set(BSP_INDICATE_ADVERTISING);
                APP_ERROR_CHECK(err_code);
                break;
    
            case BLE_ADV_EVT_IDLE:
                sleep_mode_enter();
                break;
    
            default:
                break;
        }
    }

    One reason of the restart could be that you pressed the wakeup button.

    Note that the wakeup resets the application, means that it'll restart..

    Hope that helps,

Reply Children
No Data
Related