cancel
Showing results for 
Search instead for 
Did you mean: 

MCO2, PLL2 as a source - no output on STM32H7

Issinski.Anton
Associate II
Posted on June 30, 2018 at 03:32

Used latest STM32 Cube MX to generate an empty project where MCO2 suppose to output to pin PC9 using PLL2 as a clock source. However, no output happens on PC9. If I manually change MCO2 clock source in RCC_CFGR register from PLL2 to anything else, such as SYS_CK, PLL1_P_CK or HSE, the output is OK. Only PLL2_P_CK as a source does not work.

Any suggestions what may be wrong? 

Also noticed that Cube initialises GPIO pin twice; not a big deal. Tried to use registers directly instead of HAL; still no effect.

More details: MCU: STM32H743VIT6, revision 'Y'. HSE in bypass, 10MHz. Cube clocks config screen attached.

Thanks!

#mco #pll #stm32h7
3 REPLIES 3
Posted on June 30, 2018 at 04:47

I'll see what I can get from the rev Z on the STM32H743I-EVAL

    {

     PLL1_ClocksTypeDef PLL1_Clocks;

     PLL2_ClocksTypeDef PLL2_Clocks;

     HAL_RCCEx_GetPLL1ClockFreq(&PLL1_Clocks);

     HAL_RCCEx_GetPLL2ClockFreq(&PLL2_Clocks);

     printf('PLL1_P_CK=%d, %6.2lf MHz\n', PLL1_Clocks.PLL1_P_Frequency, (double)PLL1_Clocks.PLL1_P_Frequency*1e-6);

     printf('PLL1_Q_CK=%d, %6.2lf MHz\n', PLL1_Clocks.PLL1_Q_Frequency, (double)PLL1_Clocks.PLL1_Q_Frequency*1e-6);

     printf('PLL2_P_CK=%d, %6.2lf MHz\n', PLL2_Clocks.PLL2_P_Frequency, (double)PLL2_Clocks.PLL2_P_Frequency*1e-6);

     printf('PLL2_R_CK=%d, %6.2lf MHz\n', PLL2_Clocks.PLL2_R_Frequency, (double)PLL2_Clocks.PLL2_R_Frequency*1e-6);

    }
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Issinski.Anton
Associate II
Posted on June 30, 2018 at 07:18

According to Clive Two.Zero message: To verify that PLL2 is running:

Added the following code somewhere in the middle of the application thread: 

{

    PLL1_ClocksTypeDef PLL1_Clocks;

    

PLL2_ClocksTypeDef PLL2_Clocks;

    

HAL_RCCEx_GetPLL1ClockFreq(&PLL1_Clocks);

    

HAL_RCCEx_GetPLL2ClockFreq(&PLL2_Clocks);

}

Checked with debugger: both PLL1_Clocks and 

PLL2_Clocks variables have non-zero values:

Details:{PLL1_P_Frequency = 400000000, PLL1_Q_Frequency = 100000000, PLL1_R_Frequency = 400000000}

Details:{PLL2_P_Frequency = 2000000, PLL2_Q_Frequency = 100000000, PLL2_R_Frequency = 100000000}

It is what it suppose to be: .

PLL2_P_Frequency reported as 2MHz, Cube screen also says the same value.

How do I check that MCO2 output is OK: oscilloscope. (It is not ok when PLL2 is the MCO2 clock source).

Yi Zhou
Associate III
Posted on July 03, 2018 at 18:17

See the link

https://community.st.com/0D50X00009XkYNUSA3