cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical way to not add HAL_RTCEx_SetWakeUpTimer_IT(…) call to MX_RTC_Init(void) ?

Nick Alexeev
Associate III

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. ]

1 REPLY 1
Andrew Neil
Super User

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:

https://community.st.com/t5/stm32cubeide-mcus/cubeide-2-0-does-not-open-ioc-files/m-p/857301/highlight/true#M39483

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.