cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX/STM32CubeU0 does not allow NVIC setting for singular use of IWDG

chrislro
Associate II

I like to configure IWDG (with early interrupt), but the UI in STM32CubeMX for IWDG lacks the NVIC settings tab compared to WWDG. I know that both units share the same ISR "WWDG_IWDG_IRQHandler", but why do I need to activate WWDG to get the Interrupt code generated? I really just like to use the IWDG due to its low power (stop 2) capabilities, I don't want the WWDG at all. 

How can I activate the interrupt code generation for IWDG without activating WWDG?

Is this intentionally or is this a bug in STM32CubeU0 MCU package in STM32CubeMx?

ps. latest available versions installed (6.12.1 + STM32CubeU0 Firmware Package V1.1.0 / 05-June-2024)

chrislro_0-1728459967276.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

Hello @chrislro

An internal ticket for STM32CubeMX team has been created (Ticket 195398), as it is not possible to enable the interrupt through the graphic interface.

However, you can find attached, a working project using STM32U083, at each IWDG early interrupt, the counter is refreshed and the LED toggles.

 

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.

View solution in original post

7 REPLIES 7
Sarra.S
ST Employee

Hello @chrislro

The IWDG early wakeup interrupt can be activated by changing this parameter in stm32CubeMX: 

SarraS_0-1728462556745.png

Also, there is a separate ISR named for early wakeup using HAL named: HAL_IWDG_EarlyWakeupCallback

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.

Hi,

I have not yet generated the code. I stumbled over the NVIC setting view in STM32CubeMX. When enabling solely IWDG, setting the values and selecting the IWDG early wakeup interrupt as you mentioned, still in the NVIC configuration, the respective NVIC interrupt is NOT selected and also not manually selectable as it is greyed out.  

As said, when configuring the WWDG, NVIC allows checkmarking the interrupt.

I assume without the checkmark, also code is not generated for the IWDG early wakeup interrupt ISR. As said I have not yet generated code. 

chrislro_0-1728465854067.png

ps. Currently I am using the Nucleo-U031R8

Sarra.S
ST Employee

Hello again, 

The IWDG_EarlyWakeup interrupt is different from the the NVIC interrupt (IWDG global interrupt) 

By modifying the value of the IWDG EWI you should be able to activate that interrupt and when you'll generate the code you can handle this interrupt in the dedicated ISR (IWDG_EarlyWakeupCallback) 

I was able to test this on an stm32U5 (different use case), you can check it: IWDG early wakeup interrupt in Stop modes for STM3... - STMicroelectronics Community

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.

Hm,

 

I generated code - I started just with the watchdog functionality without entering Stop mode. But this does not work. The IWDG resets the MCU after reload value as expected, but the HAL_IWDG_EarlyWakeupCallback() is never fired.
 
You provided an STM32U5 example. Somehow I doubt that the STM32U031 can do that at all. I checked the STM32U5 reference manual and compared the table "EXTI line connections" to the one for STM32U031. And surprise: the IWDG is not listed at all for U031. This might explain, why STM32CubeMX does show it like this (assuming the datasheet is correct).
 
Maybe I just switch to use the LPTIM driven by LSI. I can achieve the same functionality I need with it. I am more interested in the Interrupt to call my application assert functions, than actually doing a MCU reset. Somehow the IWDG EWI gets a little bit useless in my eyes.
 
chrislro_0-1728477165733.png

 

Sarra.S
ST Employee

Hello again @chrislro

Please let me clarify that the use case of U5 is not similar to U0, the need to enable the EXTI line in U5 4M/512k is to overcome the limitation present in U5 2M (ES0499 2.18.1)

Regarding the interrupt that's not firing, I was able to replicate the behavior on my side, so I submitted a ticket internally for further investigation (Ticket 193297).

I will keep you updated! 

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.

Got it. Thanks.

Sarra.S
ST Employee

Hello @chrislro

An internal ticket for STM32CubeMX team has been created (Ticket 195398), as it is not possible to enable the interrupt through the graphic interface.

However, you can find attached, a working project using STM32U083, at each IWDG early interrupt, the counter is refreshed and the LED toggles.

 

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.