2025-01-10 02:46 AM
Hello,
I am using freertos configured by STM32CubeMx.
The IWDG is activated and configured by STM32CubeMx too.
I met an issue in my code but this is not the purpose of this post.
Due to this issue the STM32L431 stays blocked indefinitly despite the IWDG is activated!
How can this be possible?
I never met such a case when using other OS.
Can freertos block IWDG?
Best regards
Mich.
2025-01-10 04:35 AM
Hello @mich35 ,
Check that no task in FreeRTOS is blocking the IWDG timeout period to refresh the IWDG periodically, as this can lead to the IWDG not being refreshed in time, causing a reset.
Once the IWDG is started, it cannot be stopped except by a reset. This means that if the IWDG is not refreshed within the timeout period, it should trigger a reset. So, It is important to ensure that the IWDG is refreshed within the timeout period by the tasks running in FreeRTOS.
You can check with a logic analyzer to see if IWDG is being run and to see how frequently it runs.
2025-01-10 04:42 AM
Hello Imen,
How a task in FreeRTOS can block the IWDG?
When the issue occurs (a read at a bad memory address) the IWDG is never refresh so it should trig.But it does not trig.
How can this occur?
What do you mean by "You can check with a logic analyzer to see if IWDG is being run and to see how frequently it runs."?
Best regards
Mich
2025-01-10 07:04 AM - last edited on 2025-01-10 10:48 AM by Imen.D
Nothing can block IWDG once started. FreeRTOS cannot stop IWDG.
If you forcibly hold NRST high, it will prevent a reset as that is the mechanism the chip uses to reset. That's it.
Recheck your assumptions.
2025-01-10 07:37 AM
"Nothing can block IWDG once started. FreeRTOS cannot stop IWDG."
It would wonderfull if true.
Obviously something blocks it.
Thanks for the remark that this is not related to freeRTOS but I still have no explanation.
Depending of the read memory address, either the STM32L431 stays stalled, or it trigs an HardFault ...
This last case is correct of course but not the stalled case.
I checked that IWDG by using a "while(1);" and it trigs correctly but not in the case of this bad memory address read ....