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;