stm32: Explicitly reset peripheral clocks on stm32f1

It appears some bootloaders do not properly reset some peripherals.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-03-21 12:31:59 -04:00
parent 295fb7fc85
commit 886530e777
1 changed files with 5 additions and 0 deletions

View File

@ -165,6 +165,11 @@ armcm_main(void)
SystemInit();
SCB->VTOR = (uint32_t)VectorTable;
// Reset peripheral clocks (for some bootloaders that don't)
RCC->AHBENR = 0x14;
RCC->APB1ENR = 0;
RCC->APB2ENR = 0;
// Setup clocks
clock_setup();