cancel
Showing results for 
Search instead for 
Did you mean: 

IWDT implementation in threads

meghasb
Senior

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.

1 REPLY 1
Saket_Om
ST Employee

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. 

STM32CubeU5/Projects/NUCLEO-U575ZI-Q/Examples/IWDG/IWDG_Reset at main · STMicroelectronics/STM32CubeU5 · GitHub

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om