bypass config with STDPERIPH_DRIVER
hello
i use stm32f030f4 and use 10MHz oscillator (BYPASS) and i want achieve to 48mhz in mcu.
and i use STDPERIPH_DRIVER and keil v5.what configuration i have to do ?what code i have to add to my project?
hello
i use stm32f030f4 and use 10MHz oscillator (BYPASS) and i want achieve to 48mhz in mcu.
and i use STDPERIPH_DRIVER and keil v5.what configuration i have to do ?what code i have to add to my project?
RCC_HSEConfig(RCC_HSE_ON); becomes RCC_HSEConfig(RCC_HSE_Bypass); and you don't need to wait for it to start
or something along these lines in system_stm32f0xx.c, called via SystemInit()
static void SetSysClock(void)
{/******************************************************************************/
/* HSE BYPASS used as System clock source *//******************************************************************************//* SYSCLK, HCLK, PCLK configuration ----------------------------------------*/
/* Enable HSE BYPASS */ RCC->CR |= ((uint32_t)RCC_CR_HSEBYP);/* Enable Prefetch Buffer and set Flash Latency */
FLASH->ACR = FLASH_ACR_PRFTBE | FLASH_ACR_LATENCY;/* HCLK = SYSCLK */
RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;/* PCLK = HCLK */
RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE_DIV1;/* Select HSE as system clock source */
RCC->CFGR = (RCC->CFGR | (uint32_t)((uint32_t)~(RCC_CFGR_SW))) | (uint32_t)RCC_CFGR_SW_HSE;/* Wait till PLL is used as system clock source */
while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)RCC_CFGR_SWS_HSE);}Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.