Closed r2r0 closed 2 years ago
@r2r0 could you please check if PR https://github.com/zephyrproject-rtos/zephyr/pull/44972 helps
Thanks @FRASTM - in fact this PR removes the trigger of described problem. After applying #44972 CPU leaves the while loop and the timeout hangout is avoided but it is still present.
When you build the samples/subsys/task_wdt with CONFIG_WDT_DISABLE_AT_BOOT=n
(by default in the prj.conf the CONFIG_WDT_DISABLE_AT_BOOT is 'y')
the timeout is installed during the initialisation of the device, with the same sequence as in _installtimeout
You get :
*** Booting Zephyr OS build zephyr-v3.0.0-3100-g6c4c7e87f76*
Task watchdog sample application.
Main thread still alive...
Control thread started.
Main thread still alive...
Main thread still alive...
Main thread still alive...
Control thread getting stuck...
Task watchdog channel 1 callback, thread: control
Resetting device...
Unfortunately blocking of while loop is visible only very rarely when console and debugger (even without breakpoints installed) are connected. When it happens then it looks that also LPTIM ISR is not working. After power cycling problem disappears (usually) for long time. Because I am not able to consistently reproduce problem then I will close this issue for now. BTW> @FRASTM would it be possible to advance merging of the #44972, please.
Describe the bug iwdg_stm32_install_timeout does not return because it is stuck inside
while (LL_IWDG_IsReady(iwdg) == 0)
loop. It looks like k_uptime_get_32 returns the same value for every call.Please also mention any information which could help others to understand the problem you're facing:
while
loop timeout is properly detected.k_uptime_get_32
does not work well.To Reproduce Steps to reproduce the behavior: Build with IWDG enabled and with CONFIG_WDT_DISABLE_AT_BOOT configuration option set. Try to run application.
Expected behavior
iwdg_stm32_install_timeout
should return with-EINVAL
error.Impact showstopper
Logs and console output
Environment (please complete the following information):
Additional context During call to
iwdg_stm32_install_timeout
the IWDG is disabled becauseLL_IWDG_Enable
was never called before and thenLL_IWDG_IsReady
will always return 0.LL_IWDG_Enable
was not called before because of CONFIG_WDT_DISABLE_AT_BOOT is set. It means that present implementation may be incorrect becauseLL_IWDG_Enable
will be called duringwdt_setup
which (according to documentation) will happen after call towdt_install_timeout
.