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

Bootloader hangs in "while (nrf_clock_lf_is_running())" loop.

Hi,

I have a problem, like this fellow engineer  here, but the solution is not applying for me.

Our firmware support different modes of operations. Mode changes are done through a Soft Reset. Bootloader starts before main application, and when it tries to do the nrf_drv_clock_uninit(), it will stuck and hang in stopping the LFCLK.(more accurately it will stuck and watchdog will kick in and reset the system.).

This problem only visible when I'm doing mode changes, and Soft Reset. It dose not exist running up from PIN Reset or Power On.

More specifically here:

    nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTOP);
    while (nrf_clock_lf_is_running())
    {}

I'm sure, I am doing something wrong in main application. any idea where the problem may be hiding??

(nrf52-Dev kit, SDK v14.2, )

I'm suspecting that WatchDog would cause the problem, as turning on the watchdog my cause the LFCLK to be on all the time. (just a possible scenario, I am not sure about it)

If you have any idea, would be glad to hear. Thanks guys.

Parents
  • And, one more thing i just notice. if I comment out the nrf_drv_clock_uninit(), Everything would operate smoothly,

    but another problem would pop up. At the end of OTA update, when everything is finished and bootloader is about to jump to main application, I will get watchdog rest. I don't know where would it now be stuck, as I can see it will go as following logs:

    <debug> app: Enter nrf_dfu_app_is_valid
    <debug> app: Return true. App was valid
    <debug> app: Enter nrf_dfu_app_is_valid
    €€€€rÐpˆl@@ @0@ @©pÕpÐ¨s¨s¨s¨s¨s¨s¨sªs¨s¨s¬sð( ¥J“J 	
    @j¼qåA

    I actually get the garbage characters in the end of log. After this, the watchdog reset the system. after reset bootloader would run properly and my main application run as intended.

    ( and yes I feed the watchdog all the way during the OTA and bootloader)

Reply
  • And, one more thing i just notice. if I comment out the nrf_drv_clock_uninit(), Everything would operate smoothly,

    but another problem would pop up. At the end of OTA update, when everything is finished and bootloader is about to jump to main application, I will get watchdog rest. I don't know where would it now be stuck, as I can see it will go as following logs:

    <debug> app: Enter nrf_dfu_app_is_valid
    <debug> app: Return true. App was valid
    <debug> app: Enter nrf_dfu_app_is_valid
    €€€€rÐpˆl@@ @0@ @©pÕpÐ¨s¨s¨s¨s¨s¨s¨sªs¨s¨s¬sð( ¥J“J 	
    @j¼qåA

    I actually get the garbage characters in the end of log. After this, the watchdog reset the system. after reset bootloader would run properly and my main application run as intended.

    ( and yes I feed the watchdog all the way during the OTA and bootloader)

Children
Related