cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-generating Clock Configuration

anlavandier
Associate

Hi, we are working on an open-source library OS in Rust for embedded architectures, result of a collaboration between the French research institution INRIA and the Freie Universität Berlin, called Ariel OS. Our OS currently supports a variety of STM32 MCUs and we expect the list to grow with time.
To streamline user experience, we would like to provide some ways of automatically generating the clock configuration for the STM32 MCUs. We are envisioning a utility where users simply ask for specific frequency ranges for specific clocks and this utility would figure out the correct dividers/multipliers/multiplexers to use to comply with the users requirements.
To achieve this, we would need to be able to recreate the entire clock tree logic. As far as I understand, CubeMX recreates the clock tree in software and is able to calculate frequencies based on the chosen/defaults values of the clock parameters for any MCU using some kind of configuration file. For our project we would need to have access to some kind of clock tree representation logic and to the appropriate files. Is that possible ? 

1 REPLY 1
Pavel A.
Super User

Can you think of a tool that translates Cube-generated SystemClockInit() from C to Rust?

Also, check the new development in the ST "HAL 2.0" library and related changes in generated clock init code here.