2025-11-26 11:19 AM - last edited on 2025-11-26 11:36 AM by Andrew Neil
I enabled the RTC wakeup interrupt in STM32cubeIDE graphical configer. The IDE added code to the MX_RTC_Init(void) which enables the interrupt and starts the timer. It’s the call to HAL_RTCEx_SetWakeUpTimer_IT(…) , and it’s not in the USER CODE block.
/** Enable the WakeUp
*/
if (HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0x1000, RTC_WAKEUPCLOCK_RTCCLK_DIV16) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN RTC_Init 2 */
/* USER CODE END RTC_Init 2 */I’m concerned that RTC interrupt may interfere with my own initialization, so I’d start the timer from my main() at a much later stage. I can call HAL_RTCEx_DeactivateWakeUpTimer(…) in the USER CODE to disable the timer. But is there graphical config – is there the Cube way – to tell the IDE not to add the HAL_RTCEx_SetWakeUpTimer_IT(…) call to MX_RTC_Init(void) ?
[I’m using the graphical configer in the IDE and the MX interchangeably. But if the standalone MX has better options, please let me know. ]
2025-11-26 11:39 AM - edited 2025-11-26 11:39 AM
What IDE & MX versions are you using, what Host platform, and what target?
How to write your question to maximize your chances to find a solution
Note that the latest IDE (v2.0.0) no longer has the MX part integrated: