STM32F411: Enable all GPIO-clocks in SystemInit()

Serial pins are also there.
This commit is contained in:
Nico Tonnhofer 2015-11-19 18:49:03 +01:00
parent fd81ea9c60
commit 01be683b6c
2 changed files with 7 additions and 2 deletions

View File

@ -209,6 +209,13 @@ void SystemInit(void)
/* Configure the System clock source, PLL Multiplier and Divider factors,
AHB/APBx prescalers and Flash settings */
SetSysClock();
// Enable power and clocking for all GPIO
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | \
RCC_AHB1ENR_GPIOBEN | \
RCC_AHB1ENR_GPIOCEN | \
RCC_AHB1ENR_GPIODEN | \
RCC_AHB1ENR_GPIOHEN;
}

View File

@ -22,8 +22,6 @@
void serial_init()
{
// Enable TX/RX clock (GPIOA)
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
// Enable USART2 clock
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;