From 45fd4208eac1afd46c037d10853cc1c7e670157e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Mon, 12 Dec 2022 06:07:31 +0000 Subject: [PATCH] Fixed bug #1248. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@15874 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- .../{stm32_uart10.inc => stm32_usart10.inc} | 46 +++++++++---------- os/hal/ports/STM32/STM32H7xx/stm32_isr.c | 8 +++- readme.txt | 2 + 3 files changed, 32 insertions(+), 24 deletions(-) rename os/hal/ports/STM32/LLD/USART/{stm32_uart10.inc => stm32_usart10.inc} (73%) diff --git a/os/hal/ports/STM32/LLD/USART/stm32_uart10.inc b/os/hal/ports/STM32/LLD/USART/stm32_usart10.inc similarity index 73% rename from os/hal/ports/STM32/LLD/USART/stm32_uart10.inc rename to os/hal/ports/STM32/LLD/USART/stm32_usart10.inc index 37dc29369..7bdb4d4ec 100644 --- a/os/hal/ports/STM32/LLD/USART/stm32_uart10.inc +++ b/os/hal/ports/STM32/LLD/USART/stm32_usart10.inc @@ -15,10 +15,10 @@ */ /** - * @file USART/stm32_uart10.inc - * @brief Shared UART10 handler. + * @file USART/stm32_usart10.inc + * @brief Shared USART10 handler. * - * @addtogroup STM32_UART10_HANDLER + * @addtogroup STM32_USART10_HANDLER * @{ */ @@ -31,22 +31,22 @@ /*===========================================================================*/ /* Registry checks for robustness.*/ -#if !defined(STM32_HAS_UART10) -#error "STM32_HAS_UART10 not defined in registry" +#if !defined(STM32_HAS_USART10) +#error "STM32_HAS_USART10 not defined in registry" #endif -#if STM32_HAS_UART10 +#if STM32_HAS_USART10 /* Priority settings checks.*/ -#if !defined(STM32_IRQ_UART10_PRIORITY) -#error "STM32_IRQ_UART10_PRIORITY not defined in mcuconf.h" +#if !defined(STM32_IRQ_USART10_PRIORITY) +#error "STM32_IRQ_USART10_PRIORITY not defined in mcuconf.h" #endif -#if !OSAL_IRQ_IS_VALID_PRIORITY(STM32_IRQ_UART10_PRIORITY) -#error "Invalid IRQ priority assigned to STM32_IRQ_UART10_PRIORITY" +#if !OSAL_IRQ_IS_VALID_PRIORITY(STM32_IRQ_USART10_PRIORITY) +#error "Invalid IRQ priority assigned to STM32_IRQ_USART10_PRIORITY" #endif -#endif /* STM32_HAS_UART10 */ +#endif /* STM32_HAS_USART10 */ /*===========================================================================*/ /* Driver exported variables. */ @@ -60,15 +60,15 @@ /* Driver local functions. */ /*===========================================================================*/ -static inline void uart10_irq_init(void) { -#if defined(STM32_UART10_IS_USED) - nvicEnableVector(STM32_UART10_NUMBER, STM32_IRQ_UART10_PRIORITY); +static inline void usart10_irq_init(void) { +#if defined(STM32_USART10_IS_USED) + nvicEnableVector(STM32_USART10_NUMBER, STM32_IRQ_USART10_PRIORITY); #endif } -static inline void uart10_irq_deinit(void) { -#if defined(STM32_UART10_IS_USED) - nvicDisableVector(STM32_UART10_NUMBER); +static inline void usart10_irq_deinit(void) { +#if defined(STM32_USART10_IS_USED) + nvicDisableVector(STM32_USART10_NUMBER); #endif } @@ -76,30 +76,30 @@ static inline void uart10_irq_deinit(void) { /* Driver interrupt handlers. */ /*===========================================================================*/ -#if defined(STM32_UART10_IS_USED) || defined(__DOXYGEN__) +#if defined(STM32_USART10_IS_USED) || defined(__DOXYGEN__) /** - * @brief UART10 interrupt handler. + * @brief USART10 interrupt handler. * * @isr */ -OSAL_IRQ_HANDLER(STM32_UART10_HANDLER) { +OSAL_IRQ_HANDLER(STM32_USART10_HANDLER) { OSAL_IRQ_PROLOGUE(); #if HAL_USE_SERIAL -#if STM32_SERIAL_USE_UART10 +#if STM32_SERIAL_USE_USART10 sd_lld_serve_interrupt(&SD10); #endif #endif #if HAL_USE_SIO -#if STM32_SIO_USE_UART10 +#if STM32_SIO_USE_USART10 sio_lld_serve_interrupt(&SIOD10); #endif #endif #if HAL_USE_UART -#if STM32_UART_USE_UART10 +#if STM32_UART_USE_USART10 uart_lld_serve_interrupt(&UARTD10); #endif #endif diff --git a/os/hal/ports/STM32/STM32H7xx/stm32_isr.c b/os/hal/ports/STM32/STM32H7xx/stm32_isr.c index f9630cbcb..6a37b22b1 100644 --- a/os/hal/ports/STM32/STM32H7xx/stm32_isr.c +++ b/os/hal/ports/STM32/STM32H7xx/stm32_isr.c @@ -77,7 +77,7 @@ #include "stm32_sdmmc1.inc" #include "stm32_sdmmc2.inc" -#include +#include "stm32_usart1.inc" #include "stm32_usart2.inc" #include "stm32_usart3.inc" #include "stm32_uart4.inc" @@ -85,6 +85,8 @@ #include "stm32_usart6.inc" #include "stm32_uart7.inc" #include "stm32_uart8.inc" +#include "stm32_uart9.inc" +#include "stm32_usart10.inc" #include "stm32_lpuart1.inc" #include "stm32_tim1.inc" @@ -152,6 +154,8 @@ void irqInit(void) { usart6_irq_init(); uart7_irq_init(); uart8_irq_init(); + uart9_irq_init(); + usart10_irq_init(); lpuart1_irq_init(); } @@ -207,6 +211,8 @@ void irqDeinit(void) { usart6_irq_deinit(); uart7_irq_deinit(); uart8_irq_deinit(); + uart9_irq_deinit(); + usart10_irq_deinit(); lpuart1_irq_deinit(); } diff --git a/readme.txt b/readme.txt index 43653b51d..88c25fa93 100644 --- a/readme.txt +++ b/readme.txt @@ -131,6 +131,8 @@ - NEW: Increased stacks size in RT test suite from 128 to 192. added an option to override the stack size by defining THREADS_STACK_SIZE in the makefile. +- FIX: Fixed broken support for STM32 UART9 and USART10 (bug #1248) + (backported to 21.11.3). - FIX: Fixed wrong initialization in STM32L1xx ADC driver (bug #1247) (backported to 20.3.5)(backported to 21.11.3). - FIX: Fixed wrong HSI48 support on STM32L0xx (bug #1246)