From 36dbf467644d4b4b6b9176241d42261d27fb18f2 Mon Sep 17 00:00:00 2001 From: Solodros <34903426+Solodros@users.noreply.github.com> Date: Thu, 8 Jan 2026 06:04:52 +0800 Subject: [PATCH] fix(split): correct async UART RX buffer definition (#3193) The RX buffer was previously defined as [RX_BUFFER_SIZE/2][2], which created (RX_BUFFER_SIZE/2) small 2-byte buffers instead of the two (RX_BUFFER_SIZE/2)-byte buffers required for DMA ping-pong operation. Update the buffer definition to [2][RX_BUFFER_SIZE/2] and apply the fix to both the central and peripheral wired split implementations. This prevents potential DMA RX data corruption when using async UART. --- app/src/split/wired/central.c | 2 +- app/src/split/wired/peripheral.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/split/wired/central.c b/app/src/split/wired/central.c index 157092f78..7ba661425 100644 --- a/app/src/split/wired/central.c +++ b/app/src/split/wired/central.c @@ -87,7 +87,7 @@ K_WORK_DEFINE(publish_events, publish_events_work); #if IS_ENABLED(CONFIG_ZMK_SPLIT_WIRED_UART_MODE_ASYNC) -uint8_t async_rx_buf[RX_BUFFER_SIZE / 2][2]; +uint8_t async_rx_buf[2][RX_BUFFER_SIZE / 2]; static struct zmk_split_wired_async_state async_state = { .process_tx_work = &publish_events, diff --git a/app/src/split/wired/peripheral.c b/app/src/split/wired/peripheral.c index 72300ca50..b5b91cd97 100644 --- a/app/src/split/wired/peripheral.c +++ b/app/src/split/wired/peripheral.c @@ -89,7 +89,7 @@ K_MSGQ_DEFINE(cmd_msg_queue, sizeof(struct zmk_split_transport_central_command), #if IS_ENABLED(CONFIG_ZMK_SPLIT_WIRED_UART_MODE_ASYNC) -uint8_t async_rx_buf[RX_BUFFER_SIZE / 2][2]; +uint8_t async_rx_buf[2][RX_BUFFER_SIZE / 2]; static struct zmk_split_wired_async_state async_state = { .rx_bufs = {async_rx_buf[0], async_rx_buf[1]},