From 419bee5556f2d6b4e54688832f39f2fca3847abe Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Sat, 25 Jul 2026 21:03:13 +0200 Subject: [PATCH] boards/mps2-an521: Correct the swapped UART0 TX and RX interrupts. The SSE-200 subsystem the AN521 image implements lists the UART interrupts receive first: UART0 RX is external interrupt 32 and UART0 TX is 33, which in NuttX numbering are 48 and 49. The configuration had those two the wrong way round, so the TX interrupt was dispatched to uart_cmsdk_rx_interrupt. That handler clears only UART_INTSTATUS_RX, so the asserted TX status bit survived the acknowledgement and the interrupt re-fired immediately. The board live-locked in the interrupt handler as soon as the console emitted its first character: the NSH banner appeared, and nothing ran afterwards, console input included. Note that the overflow interrupt already sits at 63, external 47, which is where the SSE-200 map puts it only if the pair below it is receive first -- the two corrected values are the ones consistent with it. mps2-an500 already follows the same order with RX at 16 and TX at 17. Assisted-by: Claude Code:claude-opus-5 Signed-off-by: Marco Casaroli --- boards/arm/mps/mps2-an521/configs/nsh/defconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boards/arm/mps/mps2-an521/configs/nsh/defconfig b/boards/arm/mps/mps2-an521/configs/nsh/defconfig index 462c9ed8e14..2b6006cfc16 100644 --- a/boards/arm/mps/mps2-an521/configs/nsh/defconfig +++ b/boards/arm/mps/mps2-an521/configs/nsh/defconfig @@ -23,9 +23,9 @@ CONFIG_CMSDK_UART0=y CONFIG_CMSDK_UART0_BASE=0x50200000 CONFIG_CMSDK_UART0_CLOCK=25000000 CONFIG_CMSDK_UART0_OV_IRQ=63 -CONFIG_CMSDK_UART0_RX_IRQ=49 +CONFIG_CMSDK_UART0_RX_IRQ=48 CONFIG_CMSDK_UART0_SERIAL_CONSOLE=y -CONFIG_CMSDK_UART0_TX_IRQ=48 +CONFIG_CMSDK_UART0_TX_IRQ=49 CONFIG_CMSDK_UART=y CONFIG_DEBUG_ASSERTIONS=y CONFIG_DEBUG_FEATURES=y