{"id":862,"date":"2024-07-15T13:12:28","date_gmt":"2024-07-15T11:12:28","guid":{"rendered":"https:\/\/redero.fr\/?p=862"},"modified":"2025-09-19T21:53:52","modified_gmt":"2025-09-19T19:53:52","slug":"clock-tree-configuration-illustrated-with-cubeide-and-zephyr","status":"publish","type":"post","link":"https:\/\/redero.fr\/?p=862&lang=en","title":{"rendered":"Clock Tree Configuration illustrated with CubeIDE and Zephyr"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Clock configuration is scary: if it doesn\u2019t work, nothing does, and debugging is not easy. Also, it is very architecture dependent, so there is no one clock tree to rule them all.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">STM32 has a nice clock configuration IDE, making it very easy to select the right clock options, so I chose it as an example to show some Zephyr clock tree implementation.<\/p>\n\n\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the Nucleo-F756ZG, the external clock is 8 MHz. Check out the <a href=\"https:\/\/www.st.com\/resource\/en\/schematic_pack\/nucleo_144pins_sch.zip\">schematics<\/a> for this NDK NX3225GD-8.0000M crystal ref:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a109a3b15c17&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a109a3b15c17\" class=\"wp-block-image size-large wp-duotone-unset-1 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"552\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_sch_nucf756-1-1024x552.png\" alt=\"\" class=\"wp-image-1087\" srcset=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_sch_nucf756-1-1024x552.png 1024w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_sch_nucf756-1-300x162.png 300w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_sch_nucf756-1-768x414.png 768w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_sch_nucf756-1.png 1464w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This clock input is also named HSE: High-Speed External oscillator.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If no external clock was present, we could use HSI (High-Speed Internal oscillator), generated in the chip itself, it is less accurate but it saves you an external component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We also need a Low-Speed clock for low-power stuff, and since there is no 32.768 KHz external clock onboard (aka LSE), we have to use the internal one (aka LSI).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s open STM32CubeIDE Clock Configuration GUI tool:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a109a3b1634b&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a109a3b1634b\" class=\"wp-block-image size-large wp-duotone-unset-2 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube-1024x521.png\" alt=\"\" class=\"wp-image-866\" srcset=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube-1024x521.png 1024w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube-300x153.png 300w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube-768x391.png 768w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube.png 1389w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This interface shows the whole clock tree system for the SoC. On the left-hand side, we can see the HSE and LSE external inputs, and how they are muxed with HSI and LSI.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Clock input<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is the Zephyr device tree description for a high-speed 8MHz external crystal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>clk_hse: clk-hse {\n        #clock-cells = &lt;0x0&gt;;\n        compatible = \"st,stm32-hse-clock\";\n        status = \"okay\";\n        hse-bypass;\n        clock-frequency = &lt;DT_FREQ_M(8)&gt;;\n};<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\" style=\"margin-top:0;margin-bottom:0\">.\/boards\/st\/nucleo_f756zg\/nucleo_f756zg.dts<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u24d8 hse-bypass means you are bypassing HSI with HSE, not that you are bypassing HSE. Device tree bindings description states:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hse-bypass: HSE crystal oscillator bypass<br>Set to the property to by-pass the oscillator with an external clock.<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">PLL configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The PLL (Phased-Locked Loop) is a hardware thingy allowing to convert one frequency to another. There is a pipeline of fixed-values multiply and divide operations, so you have to play around with maths to get to the values you want. Here we end up with 216MHz derived from the 8MHz input.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a109a3b16aa2&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a109a3b16aa2\" class=\"wp-block-image size-large wp-duotone-unset-3 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_pll-1024x521.png\" alt=\"\" class=\"wp-image-868\" srcset=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_pll-1024x521.png 1024w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_pll-300x153.png 300w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_pll-768x391.png 768w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_pll.png 1389w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>pll: pll {\n       #clock-cells = &lt;0x0&gt;;\n       compatible = \"st,stm32f7-pll-clock\";\n       status = \"okay\";\n       div-m = &lt;4&gt;;\n       mul-n = &lt;216&gt;;\n       div-p = &lt;2&gt;;\n       div-q = &lt;9&gt;;\n       clocks = &lt;&amp;clk_hse&gt;;\n};<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\" style=\"margin-top:0;margin-bottom:0\">Compiled .\/build\/zephyr\/zephyr.dts<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the CubeIDE way is not your way, it is possible to use pen and paper and calculator.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>8 \/ 4 * 216 \/ 2 = 216 MHz<\/li>\n\n\n\n<li>8 \/ 4 * 216 \/ 9 = 48 MHz<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">RCC block<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RCC means \u00ab\u00a0Reset and Clock Control\u00a0\u00bb, it is the hardware peripheral block between your clock input and the different blocks you need to feed clocks to.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a109a3b17162&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a109a3b17162\" class=\"wp-block-image size-large wp-duotone-unset-4 wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_rcc-1024x521.png\" alt=\"\" class=\"wp-image-867\" srcset=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_rcc-1024x521.png 1024w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_rcc-300x153.png 300w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_rcc-768x391.png 768w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/clock_cube_rcc.png 1389w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&amp;rcc {\n        clocks = &lt;&amp;pll&gt;;\n        clock-frequency = &lt;DT_FREQ_M(216)&gt;;\n        ahb-prescaler = &lt;1&gt;;\n        apb1-prescaler = &lt;4&gt;;\n        apb2-prescaler = &lt;2&gt;;\n};<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\" style=\"margin-top:0;margin-bottom:0\">Compiled .\/build\/zephyr\/zephyr.dts<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Peripheral clocks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Peripherals are fed by APB1 and APB2 clocks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For instance, GPIOA and GPIOB are on APB1 bus. Usually this clock configuration is hidden away in dts include provided by your manufacturer, so you can just call \u00ab\u00a0gpioa\u00a0\u00bb and add your user-related settings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">RCC AHB1 peripheral clock register (RCC_AHB1ENR)<\/h3>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a109a3b177ef&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a109a3b177ef\" class=\"wp-block-image size-large wp-duotone-default-filter wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"254\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/datasheet_RCC_AHB1-1024x254.png\" alt=\"\" class=\"wp-image-884\" srcset=\"https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/datasheet_RCC_AHB1-1024x254.png 1024w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/datasheet_RCC_AHB1-300x75.png 300w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/datasheet_RCC_AHB1-768x191.png 768w, https:\/\/redero.fr\/wp-content\/uploads\/2024\/07\/datasheet_RCC_AHB1.png 1248w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\" style=\"margin-top:0;margin-bottom:0\">Extract from <a href=\"https:\/\/www.st.com\/resource\/en\/reference_manual\/rm0385-stm32f75xxx-and-stm32f74xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf\">STM32F75xxx reference manual<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gpioa: gpio@40020000 {\n        &#091;...]\n        clocks = &lt;&amp;rcc STM32_CLOCK_BUS_AHB1 0x00000001&gt;;\n};\ngpiob: gpio@40020000 {\n        &#091;...]\n        clocks = &lt;&amp;rcc STM32_CLOCK_BUS_AHB1 0x00000002&gt;;\n};<\/code><\/pre>\n\n\n\n<p class=\"has-text-align-right has-small-font-size wp-block-paragraph\" style=\"margin-top:0;margin-bottom:0\">.\/dts\/arm\/st\/f7\/stm32f7.dtsi<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Timers, counters and PWM<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Timers are plugged to an RCC clock like any other peripherals.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They can have PWM or counter children nodes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example with the PWM blinky sample with nucleo_f091rc:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>timers2: timers@40000000 {\n        compatible = \"st,stm32-timers\";\n        reg = &lt; 0x40000000 0x400 &gt;;\n        clocks = &lt; &amp;rcc 0x1c 0x1 &gt;;\n        resets = &lt; &amp;rctl 0x200 &gt;;\n        interrupts = &lt; 0xf 0x0 &gt;;\n        interrupt-names = \"global\";\n        st,prescaler = &lt; 0x2710 &gt;;\n        status = \"okay\";\n        pwm2: pwm {\n                compatible = \"st,stm32-pwm\";\n                status = \"okay\";\n                #pwm-cells = &lt; 0x3 &gt;;\n                pinctrl-0 = &lt; &amp;tim2_ch1_pa5 &gt;;\n                pinctrl-names = \"default\";\n                phandle = &lt; 0x21 &gt;;\n        };\n        counter {\n                compatible = \"st,stm32-counter\";\n                status = \"disabled\";\n        };\n}; <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>pwmleds: pwmleds {\n        compatible = \"pwm-leds\";\n        status = \"okay\";\n        green_pwm_led: green_pwm_led {\n                pwms = &lt; &amp;pwm2 0x1 0x1312d00 0x0 &gt;;\n        };\n};<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">I hope I managed to convince you, and myself, that clocks configuration is not so scary after all. And if you want the secret method used by the best engineers I know, it is to print the clock tree diagram and use pens and highlighters to mark clock paths choices and selected values.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-f56f613f wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<iframe loading=\"lazy\" src=\"https:\/\/giphy.com\/embed\/1OYz3MODIHWplkknl7\" width=\"320\" height=\"320\" style=\"\" frameBorder=\"0\" class=\"giphy-embed\" allowFullScreen><\/iframe><p><a href=\"https:\/\/giphy.com\/stickers\/1OYz3MODIHWplkknl7\">via GIPHY<\/a><\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">And make it beautiful.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/community.st.com\/t5\/stm32-mcus\/part-1-introduction-to-the-stm32-microcontroller-clock-system\/ta-p\/605369\">https:\/\/community.st.com\/t5\/stm32-mcus\/part-1-introduction-to-the-stm32-microcontroller-clock-system\/ta-p\/605369<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.st.com\/resource\/en\/reference_manual\/rm0385-stm32f75xxx-and-stm32f74xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf\">https:\/\/www.st.com\/resource\/en\/reference_manual\/rm0385-stm32f75xxx-and-stm32f74xxx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Clock tree configuration in Zephyr demystified with real-life example, pictures, diagrams and tips.<\/p>\n","protected":false},"author":1,"featured_media":872,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[75,60,47],"class_list":["post-862","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog_en","tag-clock","tag-stm32-en","tag-zephyr-en"],"_links":{"self":[{"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/posts\/862","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/redero.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=862"}],"version-history":[{"count":43,"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions"}],"predecessor-version":[{"id":1297,"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/posts\/862\/revisions\/1297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/redero.fr\/index.php?rest_route=\/wp\/v2\/media\/872"}],"wp:attachment":[{"href":"https:\/\/redero.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=862"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redero.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=862"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redero.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}