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

Disabling the clock hangs when using LFCLK with an active watchdog

Using LFCLK, enabling and running the WDT causes the nRF52840 to hang until the watchdog reset when calling nrf_drv_clock_lfclk_release. This is with SDK v15.2.0
Steps to recreate

1) start the lfclk by
ret_code_t err_code = nrf_drv_clock_init();
APP_ERROR_CHECK(err_code);
nrf_drv_clock_lfclk_request(NULL);

2) stop the clock

nrf_drv_clock_lfclk_release();
NRF_LOG_INFO("clock release.");
nrf_drv_clock_uninit();


3) init the BLE Device as mentioned in the BLE Example
void iot_ble_initialize(void)
{
    ble_stack_init();
    gap_params_init();
    gatt_init();
    advertising_init();
    services_init();
    conn_params_init();
}

4) reset after 3 mins and go back to step1If the resets continuously happen
then randomly I see that the nrf_drv_clock_lfclk_release is getting stuck

I was able to trace the call to following:
a. nrf_drv_clock_lfclk_release
b. lfclk_stop
c. nrfx_clock_lfclk_stop
d. while(nrf_clock_lf_is_running()). <--- Hangs here Is there a reason as to why the nrf_drv_clock_lfclk_release is getting stuck
Thanks in advance.

Parents Reply Children
No Data
Related