Introduction
A real-time clock (RTC) is a computer clock that keeps track of the current time. Although the RTCs are often used in personal
computers, servers and embedded systems, they are also present in almost any electronic device that requires an accurate
time keeping. The microcontrollers supporting the RTC can be used for chronometers, alarm clocks, watches, small electronic
agendas, and many other devices.
This application note describes the RTC features and how to configure it to implement several use cases such as calendar,
alarm, wakeup, timestamp, tamper detection, or calibration.
Depending on the RTC type, the product documentation may refer to an independent TAMP that is also detailed in this
application note.
Software examples are then detailed in this document to show how to use the RTC in the low-power modes and how to ensure
the tamper detection and timestamp while the main supply is switched off and the MCU is supplied by an alternate battery.
Other examples are also presented to illustrate the following features: smooth calibration, synchronization, reference clock
detection and internal tamper.
These dedicated softwares are provided through the X-CUBE-RTC Expansion Package delivered with this application note. This
software contains the source code of these examples and all the embedded software modules required to run the examples.
In this document, the STM32 microcontroller terminology applies to the products listed in the table below.
Table 1. Applicable products
Type Products
Expansion Package X-CUBE-RTC
Microcontrollers
STM32F0 Series, STM32F2 Series, STM32F3 Series, STM32F4 Series, STM32F7 Series, STM32H7 Series,
STM32G0 Series, STM32G4 Series, STM32L0 Series, STM32L1 Series, STM32L4 Series, STM32L4+ Series,
STM32L5 Series, STM32U5 Series, STM32WB Series, STM32WL Series
Using the hardware real-time clock (RTC) and the tamper management unit
(TAMP) with STM32 microcontrollers
AN4759
Application note
AN4759 - Rev 7 - September 2021
For further information contact your local STMicroelectronics sales office.
www.st.com