Skip to main content
Andrew Neil
Super User
January 14, 2025
Question

Configure RTC Alarm separately from RTC

  • January 14, 2025
  • 1 reply
  • 1151 views

Follow on from:

https://community.st.com/t5/stm32cubemx-mcus/how-to-have-cubemx-configure-a-peripheral-but-not-enable-it/m-p/761692/highlight/true#M30801

 

To be able to configure the RTC Alarm in CubeMX, you have to enable it in CubeMX.

This means that all the configuration - of both the RTC itself, and the alarm - will be done in the MX_RTC_Init function - whereas I'd have thought it more likely that you'd want to configure and start the RTC itself separately from setting an alarm?

ie, you configure & start the RTC at startup, but you don't set the Alarm until some time later - when it's needed.

Is there a way to do that in CubeMX ?


(I'm using F0, but this seems to be general Cube MX behaviour - not specific to any series)

1 reply

ST Employee
January 15, 2025

Hello @Andrew Neil

I believe this is also related to this posted created by @TDJ : Re: CubeMX RTC config issues - STMicroelectronics Community? 

I have already submitted a ticket regarding this behavior!

Andrew Neil
Super User
January 15, 2025

Yes, that looks very similar!

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.