Skip to main content
Visitor II
May 22, 2025
Question

IWDT implementation in threads

  • May 22, 2025
  • 1 reply
  • 470 views

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.

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    May 28, 2025

    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