From debac3e3bd89c4022f4c9aa14287d5296338a7d9 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Tue, 14 Oct 2025 17:33:46 +0200 Subject: [PATCH] qemu/uart: Fix UART0 address for MPS3. Signed-off-by: iabdalkader --- ports/qemu/uart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/qemu/uart.c b/ports/qemu/uart.c index 6bf4ba6e2..35e2944c8 100644 --- a/ports/qemu/uart.c +++ b/ports/qemu/uart.c @@ -108,7 +108,7 @@ void uart_tx_strn(const char *buf, size_t len) { } } -#elif defined(QEMU_SOC_MPS2) +#elif defined(QEMU_SOC_MPS2) || defined(QEMU_SOC_MPS3) #define UART_STATE_TXFULL (1 << 0) #define UART_STATE_RXFULL (1 << 1) @@ -124,7 +124,11 @@ typedef struct _UART_t { volatile uint32_t BAUDDIV; } UART_t; +#if defined(QEMU_SOC_MPS3) +#define UART0 ((UART_t *)(0x49303000)) +#else #define UART0 ((UART_t *)(0x40004000)) +#endif void uart_init(void) { UART0->BAUDDIV = 16;