From 01be683b6c2c47984011ad8f3a9da1465aca36b5 Mon Sep 17 00:00:00 2001 From: Nico Tonnhofer Date: Thu, 19 Nov 2015 18:49:03 +0100 Subject: [PATCH] STM32F411: Enable all GPIO-clocks in SystemInit() Serial pins are also there. --- cmsis-system_stm32f4xx.c | 7 +++++++ serial-stm32.c | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cmsis-system_stm32f4xx.c b/cmsis-system_stm32f4xx.c index b3e04b5..a5d3bad 100644 --- a/cmsis-system_stm32f4xx.c +++ b/cmsis-system_stm32f4xx.c @@ -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; } diff --git a/serial-stm32.c b/serial-stm32.c index d450bd2..76c9a7c 100644 --- a/serial-stm32.c +++ b/serial-stm32.c @@ -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;