Runtime Clock Frequency Change from 168MHz to 84MHz and viceversa on stm32h743zi and stm32u575zi_q #98783
              
                Unanswered
              
          
                  
                    
                      NamrataGagare-eaton
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background:
I'm working on an embedded application using STM32H743ZI and STM32U575ZI_Q with Zephyr RTOS v3.7.1. Currently, I have a device tree overlay that configures the system clock at 168MHz, but I need the ability to dynamically switch to 84MHz at runtime.
Current Configuration:
My current device tree overlay (nucleo_h743zi.overlay) has:
/* Active 168MHz Configuration */
&pll {
div-m = <1>;
mul-n = <42>;
div-p = <2>;
div-q = <6>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(168)>;
d1cpre = <1>;
hpre = <1>;
d1ppre = <2>;
d2ppre1 = <2>;
d2ppre2 = <2>;
d3ppre = <2>;
};
&timers2 {
st,prescaler = <239>;
counter {
compatible = "st,stm32-counter";
status = "okay";
};
};
/* Desired 84MHz Configuration (currently commented) */
&pll {
div-m = <1>;
mul-n = <21>;
div-p = <2>;
div-q = <3>;
div-r = <2>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(84)>;
d1cpre = <1>;
hpre = <1>;
d1ppre = <2>;
d2ppre1 = <2>;
d2ppre2 = <2>;
d3ppre = <2>;
};
&timers2 {
st,prescaler = <1>;
counter {
compatible = "st,stm32-counter";
status = "okay";
};
};
Primary Questions:
Any guidance, code examples, or pointers to relevant documentation would be greatly appreciated!
Thanks,
Namrata Gagare
Beta Was this translation helpful? Give feedback.
All reactions