Skip to content
Snippets Groups Projects
Commit 3e0edad4 authored by Alexandre Abadie's avatar Alexandre Abadie Committed by GitHub
Browse files

Merge pull request #6877 from steffen-p/stm32_clk_init_hse_i2c

cpu/stm32f3: fix for non-functional i2c
parents 19c4facf c7e334d3
No related branches found
No related tags found
No related merge requests found
...@@ -140,5 +140,15 @@ static void cpu_clock_init(void) ...@@ -140,5 +140,15 @@ static void cpu_clock_init(void)
/* disable the HSI if we use the HSE */ /* disable the HSI if we use the HSE */
RCC->CR &= ~(RCC_CR_HSION); RCC->CR &= ~(RCC_CR_HSION);
while (RCC->CR & RCC_CR_HSIRDY) {} 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 #endif
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment