From 9eb7d1920be06ab9fb1e25f6febfc813995038c4 Mon Sep 17 00:00:00 2001 From: Alex Klimaj Date: Tue, 15 Apr 2025 04:15:15 -0600 Subject: [PATCH] STM32H7 add UART4 pins (#14341) * stm32h7: add uart4 ph13 and ph14 * stm32h7: increase UARTHARDWARE_MAX_PINS * Update src/platform/STM32/serial_uart_stm32h7xx.c Co-authored-by: Petr Ledvina * Update src/platform/STM32/serial_uart_stm32h7xx.c Co-authored-by: Petr Ledvina --------- Co-authored-by: Mark Haslinghuis Co-authored-by: Petr Ledvina --- src/platform/STM32/platform_mcu.h | 2 +- src/platform/STM32/serial_uart_stm32h7xx.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platform/STM32/platform_mcu.h b/src/platform/STM32/platform_mcu.h index 9dd2114b98..f8c2e75d80 100644 --- a/src/platform/STM32/platform_mcu.h +++ b/src/platform/STM32/platform_mcu.h @@ -399,7 +399,7 @@ extern uint8_t _dmaram_end__; #elif defined(STM32F7) #define UARTHARDWARE_MAX_PINS 4 #elif defined(STM32H7) -#define UARTHARDWARE_MAX_PINS 5 +#define UARTHARDWARE_MAX_PINS 6 #elif defined(STM32G4) #define UARTHARDWARE_MAX_PINS 3 #endif diff --git a/src/platform/STM32/serial_uart_stm32h7xx.c b/src/platform/STM32/serial_uart_stm32h7xx.c index c892077b85..bbed4b6ed0 100644 --- a/src/platform/STM32/serial_uart_stm32h7xx.c +++ b/src/platform/STM32/serial_uart_stm32h7xx.c @@ -207,14 +207,17 @@ const uartHardware_t uartHardware[UARTDEV_COUNT] = { { DEFIO_TAG_E(PA11), GPIO_AF6_UART4 }, { DEFIO_TAG_E(PB8), GPIO_AF8_UART4 }, { DEFIO_TAG_E(PC11), GPIO_AF8_UART4 }, - { DEFIO_TAG_E(PD0), GPIO_AF8_UART4 } + { DEFIO_TAG_E(PD0), GPIO_AF8_UART4 }, + { DEFIO_TAG_E(PH14), GPIO_AF8_UART4 }, + }, .txPins = { { DEFIO_TAG_E(PA0), GPIO_AF8_UART4 }, { DEFIO_TAG_E(PA12), GPIO_AF6_UART4 }, { DEFIO_TAG_E(PB9), GPIO_AF8_UART4 }, { DEFIO_TAG_E(PC10), GPIO_AF8_UART4 }, - { DEFIO_TAG_E(PD1), GPIO_AF8_UART4 } + { DEFIO_TAG_E(PD1), GPIO_AF8_UART4 }, + { DEFIO_TAG_E(PH13), GPIO_AF8_UART4 }, }, .rcc = RCC_APB1L(UART4), .irqn = UART4_IRQn,