2018-06-29 06:32 PM
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 #stm32h72018-06-29 07:47 PM
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); }2018-06-29 10:18 PM
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).
2018-07-03 09:17 AM
See the link