2025-01-03 04:30 AM - edited 2025-01-04 03:37 AM
Trying to to set up RTC alarm for STM32U5G9 I come across this CubeMX issues:
There is no option to disable Calendar date and time setup. Needless to say, probably it does not make any sense to set up date and time on every board reset if it has (as it should) some RTC battery backup.
It is not a big deal until one configures RTC alarm, function "return" statement can be added in MX_RTC_Init() 'user code' section before date/time gets reconfigured.
However, this is not an option when RTC alarm is configured because code execution needs to reach this part resetting time and date along the way.
Another reason for that is the lack of 'user code' between date/time setup and alarm setup sections in generated code. Otherwise, label and goto statement could be used to skip date/time setup.
I find lack of an option to disable date/time config very annoying. Probably this feature was never implemented because originally CubeMX was meant only to generate "quick and dirty" demo code so it did not matter.