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
  • Yes, I think the problem is WatchDog. Turning it off would fix the situation.

    I think, when we do a soft reset, watchdog still using the LFCLK, and that's why the while loop will stuck. (of course watchdog kicks in and rest the system)

    It's so strange that the bootloader doesn't account for Watchdog.

    I try to find a solution for this, as having  a watchdog is important in our application. I post here if a reliable solution have been found.

    I would be happy if Nordic engineers officially confirm my observation, and suggest a way if there is a reliable solution here.

Reply
  • Yes, I think the problem is WatchDog. Turning it off would fix the situation.

    I think, when we do a soft reset, watchdog still using the LFCLK, and that's why the while loop will stuck. (of course watchdog kicks in and rest the system)

    It's so strange that the bootloader doesn't account for Watchdog.

    I try to find a solution for this, as having  a watchdog is important in our application. I post here if a reliable solution have been found.

    I would be happy if Nordic engineers officially confirm my observation, and suggest a way if there is a reliable solution here.

Children
No Data
Related