I am using STM32L051, our task has two requirements for clock management:
- Need to be running under 16Mhz or higher frequency (thus we use the MSI/HSI for Systick) for fast task processing.
- Need a higher precision clock source (50ppm 32khz LSE is ok; and our board has an external 20ppm 32khz crystal) to limit the clock deviation to about 100ms per 30minutes.
How can I configure the clock system to use both the MSI/HSI (for Systick) and external 32khz crystal (for lower clock deviation)?
I have searched the datasheet and google a lot, however didn't find a solution. I am not familiar with MCU development. Please kindly refer me to the datasheet section (several keyword is ok) or cortex-driver API for further research, thanks!