Question
Error stm32G030 not specified in the errata file.
When using RTC, the GPIO pin state of PA4 may be corrupted. RM0454, section 23.3.3 says:
"In addition, it is possible to output RTC_OUT2 on PA4 pin thanks to OUT2EN bit. This
output is not available in VBAT mode. The different functions are mapped on RTC_OUT1 or on RTC_OUT2 depending on OSEL, COE and OUT2EN configuration, as show in table
Table91.
For PA4, the GPIO should be configured as an alternate function."
But, as my experience has shown, RTC_OUT2 gets to PA4 even when PA4 is in mode GPIO OUTPUT.
In addition, the RTC_CR_OUT2EN and RTC_CR_COE bits do not affect the operation of PA4 in any way. (See Table 91. RTC_OUT mapping)
In my case, RTC->CR was initialized like this:
RTC->CR =
3 << RTC_CR_OSEL_Pos | //Output selection: 0-disabled, 1-Alarm A, 2-Alarm B, 3-Wakeup
1 << RTC_CR_WUTE_Pos | //Wakeup timer: 0-disable, 1-enable
1 << RTC_CR_BYPSHAD_Pos; //0-values taken from shadow regs; 1-Bypass the shadow regs.
The effect of RTC on PA4 operation stopped when I changed the contents of the RTC_CR_OSEL field to 00:
RTC->CR =
1 << RTC_CR_WUTE_Pos |
1 << RTC_CR_BYPSHAD_Pos;
