2021-07-07 02:56 AM
I create a STM32CubeMx project (test.ioc) for a NUCLEO-H745ZI-Q board and select PPL3 to clock the ADC, but the function PeriphCommonClock_Config() is not generated unless I also clock the USB from PPL3 as well.
After enabling a single ADC1 channel I change the clocking as shown below
I then toggle the clock source for the USB and captured the code generated for each option as shown below. Left side is ADC clocked by PLL3, right side is is ADC and USB clocked by PLL3
So it looks like STM32CubeMx is ignoring the generation of PeriphCommonClock_Config() when only the ADC is clocked from PLL3.
I think this is a bug in STM32CubeMX code generation.
cheers
Chris
Solved! Go to Solution.
2021-07-13 02:44 AM
Hello @CHossack ,
Let me thank you first for your feedback :smiling_face_with_smiling_eyes:
If I've correctly understood your post, PeriphCommonClock_Config() function is only generated when the PLL is the common clock source for two peripherals (PLL3 is used as the clock source for both ADC and USB in your case).
Actually, this is the expected behavior of STM32CubeMX. As indicated by its name PeriphCommonClock_Config() function is used for Peripherals Common Clock Configuration i.e. when two or more peripherals share the same clock source.
To sum up, STM32CubeMX assure the generation of two kind of configurations:
Hope that I've answered your question. If this the case, please close this post by clicking the Select as Best button on my reply . This will help other members of the community find this response more quickly :)
Do not hesitate to raise any issue/ feedback.
Khouloud.
2021-07-07 08:37 AM
Hello @CHossack ,
This post is related to CubeMx tool, so I added topic "STM32CubeMX" to your post in order to increase its chance to be reviewed by our CubeMx team.
Hello @Khouloud ZEMMELI , @Khouloud OTHMAN ,
Can you please check this issue ?
Imen
2021-07-13 02:44 AM
Hello @CHossack ,
Let me thank you first for your feedback :smiling_face_with_smiling_eyes:
If I've correctly understood your post, PeriphCommonClock_Config() function is only generated when the PLL is the common clock source for two peripherals (PLL3 is used as the clock source for both ADC and USB in your case).
Actually, this is the expected behavior of STM32CubeMX. As indicated by its name PeriphCommonClock_Config() function is used for Peripherals Common Clock Configuration i.e. when two or more peripherals share the same clock source.
To sum up, STM32CubeMX assure the generation of two kind of configurations:
Hope that I've answered your question. If this the case, please close this post by clicking the Select as Best button on my reply . This will help other members of the community find this response more quickly :)
Do not hesitate to raise any issue/ feedback.
Khouloud.
2021-07-13 08:58 AM
Hi Khouloud,
Thank you for your explanation. That makes perfect sense.
cheers
chris