Skip to main content
Associate
September 3, 2026
Question

CubeMX2: IWDG time unit selection does not change USE_HAL_IWDG_TIME_UNIT value

In STM32CubeMX2 1.1.1, for the STM32C542RC MCU, enable the IWDG.
In “Applicative services”, enable “Start function generation”. In the subfolder “Calculator”, you have the possibility to change the “Time unit”. Set it to “Seconds”. The only change is the unit used in comments, e.g.:
 

/*
Start the Independent Watchdog (IWDG) with the following parameters:
- Maximum time before watchdog reset : 132 seconds
- Minimum time before refresh (window) : 0 seconds
- Early Wakeup Interrupt (EWI) time : 0 seconds
*/
hal_status_t mx_iwdg_start(void)
{
return HAL_IWDG_Start(&hIWDG, 0UL, 132UL, 0UL);
}

The arguments given to HAL_IWDG_Start() are not updated by this unit change. So the configuration of the time unit in this window is useless and does not touch any part of actual code. This is a problem and should be fixed.

For the unit change to effectively take effect, it is currently done in “Project settings” → “HAL common definitions” → “HAL IWDG” → “Use HAL IWDG time unit”. We can now select the time unit, that will define the variable USE_HAL_IWDG_TIME_UNIT in stm32c5xx_hal_conf.h.

1 reply

Oussama_TROUDI
ST Technical Moderator
September 16, 2026

Hello ​@TheBigBadBoy 
Thank you for the detailed description.

I have submitted an internal tracking ticket for this issue. It is currently under investigation and being worked on. I will get back to you as soon as I receive more details.

Internal ticket number: CDM0065809 (This is an internal tracking number and is not accessible or usable by customers).

Best Regards
Oussama

In order 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.