Page 1 of 1

Incorrect SerialDriver instance use for UART9 init in USARTv3/hal_serial_lld.c

Posted: Sun Aug 18, 2024 6:53 pm
by ych
It seems copy-paste typo in UART9 init section where SD8 used instead of SD9:

Code: Select all

diff --git a/os/hal/ports/STM32/LLD/USARTv3/hal_serial_lld.c b/os/hal/ports/STM32/LLD/USARTv3/hal_serial_lld.c
index fca0443cf..984621a4f 100644
--- a/os/hal/ports/STM32/LLD/USARTv3/hal_serial_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv3/hal_serial_lld.c
@@ -773,10 +773,10 @@ void sd_lld_init(void) {
 
 #if STM32_SERIAL_USE_UART9
   sdObjectInit(&SD9);
-  iqObjectInit(&SD9.iqueue, sd_in_buf9, sizeof sd_in_buf9, NULL, &SD8);
-  oqObjectInit(&SD9.oqueue, sd_out_buf9, sizeof sd_out_buf9, notify9, &SD8);
-  SD8.usart = UART9;
-  SD8.clock = STM32_UART9CLK;
+  iqObjectInit(&SD9.iqueue, sd_in_buf9, sizeof sd_in_buf9, NULL, &SD9);
+  oqObjectInit(&SD9.oqueue, sd_out_buf9, sizeof sd_out_buf9, notify9, &SD9);
+  SD9.usart = UART9;
+  SD9.clock = STM32_UART9CLK;
 #if !defined(STM32_UART9_SUPPRESS_ISR) && defined(STM32_UART9_NUMBER)
   nvicEnableVector(STM32_UART9_NUMBER, STM32_SERIAL_UART9_PRIORITY);
 #endif

Re: Incorrect SerialDriver instance use for UART9 init in USARTv3/hal_serial_lld.c

Posted: Sun Aug 18, 2024 6:58 pm
by ych
It will be great if this fix could be applied to the stable_21.11.x branch.

Re: Incorrect SerialDriver instance use for UART9 init in USARTv3/hal_serial_lld.c

Posted: Tue Aug 27, 2024 9:41 am
by Giovanni
Hi,

Fixed in trunk and stable.

Giovanni

Re: Incorrect SerialDriver instance use for UART9 init in USARTv3/hal_serial_lld.c

Posted: Tue Aug 27, 2024 10:45 am
by anotheruserofchibios
Hi, it looks like you missed SD8 on lines 778 and 779. ;)