• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..22-Aug-2025-

boards/22-Aug-2025-

src/22-Aug-2025-

CMakeLists.txt A D22-Aug-2025228 96

README.rst A D22-Aug-20251 KiB4431

prj.conf A D22-Aug-202535 31

sample.yaml A D22-Aug-2025470 2221

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