2018-09-17 11:11 AM
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?
2018-09-17 11:23 AM
>>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.
2018-09-18 04:31 AM
Thanks Clive, as usual is a stupid mistake of mine.