2025-05-22 12:27 AM - last edited on 2025-05-27 9:40 AM by Amel NASRI
Hi all,
I'm trying to implement the Independent Watchdog Timer (IWDT) on a TrustZone-enabled STM32U5 controller. My goal is to configure and run the IWDT from the Non-Secure (NS) area.
Here’s what I’ve done so far:
I have an Azure RTOS ThreadX-based application.
I've created a thread that runs every 10 seconds.
Inside this thread, I’m initializing the IWDT and then calling HAL_IWDG_Refresh().
I’ve configured the IWDT for a timeout of 11 seconds.
However, I’m getting a Hard Fault when this thread executes.
What I'm looking for:
A working reference or example of IWDT implementation in a ThreadX thread in the Non-Secure area on a TrustZone-enabled STM32 (e.g., STM32U585).
Guidelines on how and where to initialize the IWDT (Secure vs Non-Secure).
Any TrustZone-related permission issues I should be aware of (e.g., Secure access required to certain RCC or watchdog registers?).
Any best practices on refreshing IWDT from a thread instead of an interrupt or bare-metal loop.
2025-05-28 6:07 AM
Hello @meghasb
First you should have the IWDG work without FreeRTOS and then you can add the OS.
please refer to the example below as starting point.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.