From f9e9a8eca322147c3cdca5f9fafb6930514db325 Mon Sep 17 00:00:00 2001 From: gguidone Date: Fri, 31 Jul 2026 14:02:44 +0200 Subject: [PATCH] feat(boards/px4/fmu-v4): size the serial buffers uniformly Four of the seven ports carry hand-inflated buffers while every other port on the board uses 300. They are static allocations, so they come straight off the heap arena, on a board that runs out of heap before MAVLink can start (#28109). USART1 TX 2500 -> 600 ESP8266 header, usually unpopulated USART2 TX 1100 -> 600 TELEM1 USART3 RX 1200 -> 600 TELEM2 USART3 TX 900 -> 600 Effect: 3328 B of static RAM returned, flash unchanged. Measured with the NuttX submodule cleaned, since it builds in-tree and does not rebuild on a config change, and verified in the ELF with nm. No functionality is removed. What is given up is burst headroom: MAVLink defers when a TX buffer is full, so a stream is throttled rather than lost, and 600 B is still 83 ms at 57600 baud. Both telemetry ports have hardware flow control and RX DMA, so a full RX ring asserts RTS instead of dropping bytes. This cannot affect the failure in #28109, which is on USB, a CDCACM link with its own separate buffers. --- boards/px4/fmu-v4/nuttx-config/nsh/defconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig index 90876496a2f..219c5d2e84a 100644 --- a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig @@ -235,19 +235,19 @@ CONFIG_UART8_RXBUFSIZE=300 CONFIG_UART8_TXBUFSIZE=300 CONFIG_USART1_RXBUFSIZE=600 CONFIG_USART1_RXDMA=y -CONFIG_USART1_TXBUFSIZE=2500 +CONFIG_USART1_TXBUFSIZE=600 CONFIG_USART2_BAUD=57600 CONFIG_USART2_IFLOWCONTROL=y CONFIG_USART2_OFLOWCONTROL=y CONFIG_USART2_RXBUFSIZE=600 CONFIG_USART2_RXDMA=y -CONFIG_USART2_TXBUFSIZE=1100 +CONFIG_USART2_TXBUFSIZE=600 CONFIG_USART3_BAUD=57600 CONFIG_USART3_IFLOWCONTROL=y CONFIG_USART3_OFLOWCONTROL=y -CONFIG_USART3_RXBUFSIZE=1200 +CONFIG_USART3_RXBUFSIZE=600 CONFIG_USART3_RXDMA=y -CONFIG_USART3_TXBUFSIZE=900 +CONFIG_USART3_TXBUFSIZE=600 CONFIG_USART6_BAUD=57600 CONFIG_USART6_RXBUFSIZE=300 CONFIG_USART6_RXDMA=y