• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

boards/29-Dec-2025-274161

socs/29-Dec-2025-2016

src/29-Dec-2025-6748

CMakeLists.txtD29-Dec-2025220 96

README.rstD29-Dec-20251,017 4431

prj.confD29-Dec-202533 31

sample.yamlD29-Dec-2025823 3332

README.rst

1.. zephyr:code-sample:: rtc
2   :name: Real-Time Clock (RTC)
3   :relevant-api: rtc_interface
4
5   Set and read the date/time from a Real-Time Clock.
6
7Overview
8********
9
10This sample shows how to use the :ref:`rtc driver API <rtc_api>`
11to set and read the date/time from RTC and display on the console
12and can be built and executed on boards supporting RTC.
13
14Building and Running
15********************
16
17Build and flash as follows, replacing ``stm32f3_disco`` with your board:
18
19.. zephyr-app-commands::
20   :zephyr-app: samples/drivers/rtc
21   :board: stm32f3_disco
22   :goals: build flash
23   :compact:
24
25.. zephyr-app-commands::
26   :zephyr-app: samples/drivers/rtc
27   :board: mimxrt700_evk/mimxrt798s/cm33_cpu0
28   :goals: build flash
29
30.. zephyr-app-commands::
31   :zephyr-app: samples/drivers/rtc
32   :board: mimxrt700_evk/mimxrt798s/cm33_cpu1
33   :goals: build ram
34
35Sample Output
36=============
37
38.. code-block:: console
39
40   RTC date and time: 2024-11-17 04:19:00
41   RTC date and time: 2024-11-17 04:19:01
42
43   <repeats endlessly>
44