cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_RCCEx_GetPeriphCLKFreq (RCC_PERIPHCLK_USART2) function

Zanon.Luciano
Senior

Hi, I'm working with the stm32f030c8 processor and I'm trying to use the MY_VAR = HAL_RCCEx_GetPeriphCLKFreq (RCC_PERIPHCLK_USART2) function;

But in the stm32f0xx_hal_rcc_ex.h file there is no definition of RCC_PERIPHCLK_USART2 for the stm32f030c8 which has usart2 ..

Am I doing something wrong or is the stm32f0xx_hal_rcc_ex.h file buggy?

2 REPLIES 2

>>Am I doing something wrong or is the stm32f0xx_hal_rcc_ex.h file buggy?

The former. Review the clock tree diagram in the data sheet.

https://www.st.com/resource/en/datasheet/stm32f030c8.pdf

USART2 can only use the APB clock, you don't have a secondary option, and that's not furnished in the library accordingly.

0690X000006C2RZQA0.jpg

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Zanon.Luciano
Senior

Thanks Clive, as usual is a stupid mistake of mine.