Replies: 1 comment
-
@lajjan The ability to configure clock source for each device is not available right now. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I'm looking for a way to control the clock source for different peripherals, e.g. changing the clock for USART2 from PCLK1 to SYSCLK.
I've went through all the documentation for both DeviceTree and KConfig, and found how to change the PLL, APBx settings etc and can see that all peripherals have a "clocks" parameter in the DT, but I have a hard time figuring out how to specify it to use SysCLK instead of PCLK1 in the case of USART2 for instance. I've figured out that the default value "clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00020000>;" refers to the register RCC_APB1ENR1 and that USART 2 is enabled through bit 17 (0x00020000), but I can't find any code that is changing the RCC_CCIPR register which controls the clock sources.
If I wouldn't be using Zephyr I would use either LL_RCC_SetUSARTClockSource or HAL_RCCEx_PeriphCLKConfig to configure this, which I've also tried, but when I arrive to my code all the initialization of the peripherals has already been done.
Maybe it's not possible to do or it is just me who are new to Zephyr and don't understand how everything is connected, if so, please guide to the right path :)
/Linus
Beta Was this translation helpful? Give feedback.
All reactions