From a119b5bd9f42b59dbaca756a1caeea6cc84926a2 Mon Sep 17 00:00:00 2001 From: Brian Starkey Date: Mon, 4 Oct 2021 19:24:50 +0100 Subject: [PATCH] Fix semihosting_putc (#530) Per the Arm semihosting protocol documentation[1], the SYS_WRITEC command expects *a pointer to* the character to be printed in r1, not the character itself. [1] https://developer.arm.com/documentation/dui0471/g/Semihosting/SYS-WRITEC--0x03-?lang=en --- src/rp2_common/pico_stdio_semihosting/stdio_semihosting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rp2_common/pico_stdio_semihosting/stdio_semihosting.c b/src/rp2_common/pico_stdio_semihosting/stdio_semihosting.c index 8936770..9d8775d 100644 --- a/src/rp2_common/pico_stdio_semihosting/stdio_semihosting.c +++ b/src/rp2_common/pico_stdio_semihosting/stdio_semihosting.c @@ -18,7 +18,7 @@ // ); //} -static void __attribute__((naked)) semihosting_putc(char c) { +static void __attribute__((naked)) semihosting_putc(const char *c) { __asm ( "mov r1, r0\n" @@ -31,7 +31,7 @@ static void __attribute__((naked)) semihosting_putc(char c) { static void stdio_semihosting_out_chars(const char *buf, int length) { for (uint i = 0; i