From c849ddfebb1254289211e2d95dca30e21ee1bfbb Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Fri, 17 Mar 2023 08:17:35 +0100 Subject: [PATCH] Reverted accidental changes in uart_drv_stm32wb --- hal/uart/uart_drv_stm32wb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hal/uart/uart_drv_stm32wb.c b/hal/uart/uart_drv_stm32wb.c index 616ec4c5..bcb3bf80 100644 --- a/hal/uart/uart_drv_stm32wb.c +++ b/hal/uart/uart_drv_stm32wb.c @@ -51,6 +51,9 @@ #define CLOCK_SPEED (64000000) /* 64 MHz (STM32WB55) */ +#define APB2_CLOCK_ER (*(volatile uint32_t *)(0x58000060)) +#define UART1_APB2_CLOCK_ER_VAL (1 << 14) + #define AHB2_CLOCK_ER (*(volatile uint32_t *)(0x5800004c)) #define GPIOB_AHB2_CLOCK_ER (1 << 1) #define GPIOB_BASE 0x48000400 @@ -103,6 +106,8 @@ int uart_init(uint32_t bitrate, uint8_t data, char parity, uint8_t stop) /* Enable pins and configure for AF7 */ uart_pins_setup(); + /* Turn on the device */ + APB2_CLOCK_ER |= UART1_APB2_CLOCK_ER_VAL; UART1_CR1 &= ~(UART_CR1_UART_ENABLE); UART1_CR1 &= ~(UART_CR1_FIFO_ENABLE);