README.rst
1.. zephyr:code-sample:: stm32_mco
2 :name: Master Clock Output (MCO)
3 :relevant-api: pinctrl_interface
4
5 Output an internal clock for external use by the application.
6
7Overview
8********
9
10This sample is a minimum application to demonstrate how to output one of the internal clocks for
11external use by the application.
12
13Requirements
14************
15
16The SoC should support MCO functionality and use a pin that has the MCO alternate function.
17To support another board, add a dts overlay file in boards folder.
18Make sure that the output clock is enabled in dts overlay file.
19Depending on the stm32 serie, several clock source and prescaler are possible for each MCOx.
20The clock source is set by the DTS among the possible values for each stm32 serie.
21The prescaler is set by the DTS, through the property ``prescaler = <MCOx_PRE(MCO_PRE_DIV_n)>;``
22
23See :zephyr_file:`dts/bindings/clock/st,stm32-clock-mco.yaml`
24
25It is required to check the Reference Manual to configure the DTS correctly.
26
27
28Building and Running
29********************
30
31.. zephyr-app-commands::
32 :zephyr-app: samples/boards/st/mco
33 :board: nucleo_u5a5zj_q
34 :goals: build flash
35
36After flashing, the LSE clock will be output on the MCO pin enabled in Device Tree.
37The clock can be observed using a probing device, such as a logic analyzer.
38