Electronic – Is STM32 RTC halted during debug or not

debuggingrtcstm32

I'm working with STM32F411RE but I presume the problem is the same for any STM32F, and possibly others.

I couldn't find in the reference manual whether or not the RTC is halted during a debug session. For any other IPs, including those clocked with different clock sources like the watchdog IP, it's clearly mentioned that debug halting is configurable or at least the behavior is fixed and given.

What about the RTC ?

Best Answer

Found the solution: The STM32F411 have a register on the debug IP controlling the halted state of the RTC. Register is

Debug MCU APB1 freeze register (DBGMCU_APB1_FZ)

Reset state is 0. The field is

Bit 10 DBG_RTC_STOP: RTC stopped when Core is halted

0: The RTC counter clock continues even if the core is halted

1: The RTC counter clock is stopped when the core is halted

Reference manual p 830

My mistake was to not search in the debug IP part of the documentation but in the RTC part.