diff --git a/cpu/stm32f3/cpu.c b/cpu/stm32f3/cpu.c index 66bb7763a76191bb7cb42c2db09a094eed65bc38..e6f99ece3e7ae4eef5486f097c8711fd77f9ca61 100644 --- a/cpu/stm32f3/cpu.c +++ b/cpu/stm32f3/cpu.c @@ -140,5 +140,15 @@ static void cpu_clock_init(void) /* disable the HSI if we use the HSE */ RCC->CR &= ~(RCC_CR_HSION); while (RCC->CR & RCC_CR_HSIRDY) {} + + /* swith I2Cx clock source to SYSCLK */ + RCC->CFGR3 &= ~(RCC_CFGR3_I2CSW); + RCC->CFGR3 |= RCC_CFGR3_I2C1SW_SYSCLK; +#ifdef RCC_CFGR3_I2C2SW_SYSCLK + RCC->CFGR3 |= RCC_CFGR3_I2C2SW_SYSCLK; +#endif +#ifdef RCC_CFGR3_I2C3SW_SYSCLK + RCC->CFGR3 |= RCC_CFGR3_I2C3SW_SYSCLK; +#endif #endif }