Skip to content

arch/arm/stm32h5/serial: fix UART8 buffer guard typo - #19701

Merged
acassis merged 1 commit into
apache:masterfrom
joaomariolago:fix/stm32h5-uart8-guard
Aug 5, 2026
Merged

arch/arm/stm32h5/serial: fix UART8 buffer guard typo#19701
acassis merged 1 commit into
apache:masterfrom
joaomariolago:fix/stm32h5-uart8-guard

Conversation

@joaomariolago

Copy link
Copy Markdown
Contributor

Summary

In stm32h5/stm32_serial.c, the UART8 RX/TX buffer definitions were guarded by CONFIG_STM32H8_UART8_SERIALDRIVER (typo). The rest of the UART8 serial instance correctly uses CONFIG_STM32_UART8_SERIALDRIVER.

This change corrects the guard to CONFIG_STM32_UART8_SERIALDRIVER so the buffers are compiled with the UART8 driver.

NOTE: The compile failure only shows up when UART8 serial is actually selectable on H5. That requires the UART7/8 Kconfig gate-keeping fix from #19700; without it, CONFIG_STM32_UART8_SERIALDRIVER is dropped and this typo stays latent.

Impact

  • Fixes STM32H5 UART8 serial builds once CONFIG_STM32_UART8_SERIALDRIVER is enabled.

Testing

Tested compiling nucleo-h563zi:nsh with UART8 configured (together with the Kconfig fix from #19700).

Board code patch used for this test: nucleo-h563zi-nsh-uart8-typo-test.patch

Build configuration:

cmake -B build -DBOARD_CONFIG=nucleo-h563zi:nsh -GNinja
cmake --build build

Without this change (Compilation fails)

cmake --build build
[39/1164] Building C object arch/CMakeFiles/arch.dir/arm/src/stm32h5/stm32_serial.c.o
FAILED: [code=1] arch/CMakeFiles/arch.dir/arm/src/stm32h5/stm32_serial.c.o

...

nuttx/arch/arm/src/stm32h5/stm32_serial.c:1058:19: error: 'g_uart8rxbuffer' undeclared here (not in a function); did you mean 'g_usart3rxbuffer'?
 1058 |         .buffer = g_uart8rxbuffer,
      |                   ^~~~~~~~~~~~~~~
      |                   g_usart3rxbuffer
nuttx/arch/arm/src/stm32h5/stm32_serial.c:1063:19: error: 'g_uart8txbuffer' undeclared here (not in a function); did you mean 'g_usart3txbuffer'?
 1063 |         .buffer = g_uart8txbuffer,
      |                   ^~~~~~~~~~~~~~~
      |                   g_usart3txbuffer
[56/1164] Building C object arch/CMakeFiles/arch.dir/arm/src/common/arm_usestack.c.o
ninja: build stopped: subcommand failed.

With this change (Compilation succeeds)

cmake --build build
[1162/1164] Linking CXX executable nuttx
Memory region         Used Size  Region Size  %age Used
           flash:      227392 B         2 MB     10.84%
            sram:       10512 B       256 KB      4.01%
[1164/1164] Generating System.map

Use CONFIG_STM32_UART8_SERIALDRIVER so g_uart8rxbuffer and
g_uart8txbuffer are compiled when UART8 is enabled.

Signed-off-by: Joao Mario Lago <joao.mario.lago@hotmail.com>
@github-actions github-actions Bot added Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small labels Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@hartmannathan hartmannathan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thank you

@acassis
acassis merged commit bfad05b into apache:master Aug 5, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: XS The size of the change in this PR is very small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants