D3SXX / STM32-Battery-Management

MIT License
0 stars 0 forks source link

Check STMCube for the Toolchain #3

Open SergiuPetrut opened 1 year ago

Zhguye commented 1 year ago

External oscillators are more accurate because of the imprecision, temperature/supply voltage dependence, and jitter of the internal oscillators. Currently the settings are configured to use the HSI on 16Mhz (these are the unaltered values for the NUCLEO-L152RE) image

Maybe useful code if hsi has problems

//

RCC->CFGR |= RCC_CFGR_SW_HSI; //set hsi as systemclk while((RCC->CR & RCC_CFGR_SWS_HSI)!= RCC_CFGR_SWS_HSI);

RCC->CFGR |= (RCC_CFGR_MCOSEL_SYSCLK); //set mco output to sysclk