README.rst
1.. _rtc_clk_test:
2
3Espressif's RTC Clock test
4##########################
5
6Overview
7********
8
9This test iterates through all the clock sources and checks if the expected frequency is being set.
10Espressif SOCs have 3 main clock subsystems: CPU, RTC_FAST and RTC_SLOW. Each of these subsystems have their own clock sources and possible rates.
11
12
13Supported Boards
14****************
15- esp32_devkitc_wrover/esp32/procpu
16- esp32c3_devkitm
17- esp32c6_devkitc
18- esp32s2_saola
19- esp32s3_devkitm/esp32s3/procpu
20
21Building and Running
22********************
23
24Make sure you have the target connected over USB port.
25
26.. code-block:: console
27
28 west build -b <board> tests/boards/espressif/rtc_clk
29 west flash && west espressif monitor
30
31To run the test with twister, use the following command:
32
33.. code-block:: console
34
35 west twister -p <board> --device-testing --device-serial=/dev/ttyUSB0 -vv --flash-before -T tests/boards/espressif/rtc_clk
36
37If the external 32K crystal is connect to pins 32K_XP and 32K_XN, the test can be run with ``external_xtal`` fixture enabled:
38
39.. code-block:: console
40
41 west twister -p esp32c3_devkitm --device-testing --device-serial=/dev/ttyUSB0 -vv --flash-before -T tests/boards/espressif/rtc_clk -X external_xtal
42
43Sample Output
44=============
45
46.. code-block:: console
47
48 *** Booting Zephyr OS build v3.6.0-3162-g529005998ea6 ***
49 Running TESTSUITE rtc_clk
50 ===================================================================
51 CPU frequency: 240000000
52 RTC_FAST frequency: 17500000
53 RTC_SLOW frequency: 136000
54 START - test_cpu_pll_src
55 Testing CPU frequency: 80 MHz
56 Testing CPU frequency: 160 MHz
57 Testing CPU frequency: 240 MHz
58 PASS - test_cpu_pll_src in 0.020 seconds
59 ===================================================================
60 START - test_cpu_xtal_src
61 Testing CPU frequency: 40 MHz
62 Testing CPU frequency: 20 MHz
63 Testing CPU frequency: 10 MHz
64 Testing CPU frequency: 5 MHz
65 PASS - test_cpu_xtal_src in 17.645 seconds
66 ===================================================================
67 START - test_rtc_fast_src
68 Testing RTC FAST CLK freq: 20000000 MHz
69 Testing RTC FAST CLK freq: 17500000 MHz
70 PASS - test_rtc_fast_src in 0.001 seconds
71 ===================================================================
72 START - test_rtc_slow_src
73 Testing RTC SLOW CLK freq: 136000 MHz
74 Testing RTC SLOW CLK freq: 68359 MHz
75 PASS - test_rtc_slow_src in 0.002 seconds
76 ===================================================================
77 TESTSUITE rtc_clk succeeded
78 ------ TESTSUITE SUMMARY START ------
79 SUITE PASS - 100.00% [rtc_clk]: pass = 4, fail = 0, skip = 0, total = 4 duration = 17.668 seconds
80 - PASS - [rtc_clk.test_cpu_pll_src] duration = 0.020 seconds
81 - PASS - [rtc_clk.test_cpu_xtal_src] duration = 17.645 seconds
82 - PASS - [rtc_clk.test_rtc_fast_src] duration = 0.001 seconds
83 - PASS - [rtc_clk.test_rtc_slow_src] duration = 0.002 seconds
84 ------ TESTSUITE SUMMARY END ------
85 ===================================================================
86 PROJECT EXECUTION SUCCESSFUL
87