From 68ecf10027535c0f93fdbcfc5991f757d0c7ebdb Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 5 Jul 2024 12:34:06 +0100 Subject: [PATCH] Fix Rp2040 cyw43 firmware build bug (#2854) Bad Rp2040 cyw43 firmware build bug, introduced in #2804. Also ensure builds work with previous 10.3.1 toolchain. --- Sming/Arch/Rp2040/Components/rp2040/firmware/build.sh | 2 +- Sming/Arch/Rp2040/app.mk | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Sming/Arch/Rp2040/Components/rp2040/firmware/build.sh b/Sming/Arch/Rp2040/Components/rp2040/firmware/build.sh index 00b1be548c..e6807ee223 100755 --- a/Sming/Arch/Rp2040/Components/rp2040/firmware/build.sh +++ b/Sming/Arch/Rp2040/Components/rp2040/firmware/build.sh @@ -8,7 +8,7 @@ set -e write_chunk() { - sz=$(printf "%08x" $(wc -c "$1" | awk '{print $$1}')) + sz=$(printf "%08x" $(wc -c "$1" | awk '{print $1}')) # Output 8-byte header containing chunk tag plus length in little-endian format printf "CHNK\x${sz:6:2}\x${sz:4:2}\x${sz:2:2}\x${sz:0:2}" >> $2 # Append chunk data diff --git a/Sming/Arch/Rp2040/app.mk b/Sming/Arch/Rp2040/app.mk index f96bc1d8f0..97bd3ab590 100644 --- a/Sming/Arch/Rp2040/app.mk +++ b/Sming/Arch/Rp2040/app.mk @@ -6,12 +6,15 @@ # linker flags used to generate the main object file LDFLAGS += \ - -Wl,--no-warn-rwx-segments \ -Wl,--build-id=none \ --specs=nosys.specs \ -mcpu=cortex-m0plus \ -mthumb +ifneq ($(COMPILER_VERSION_MAJOR),10) +LDFLAGS += -Wl,--no-warn-rwx-segments +endif + TARGET_DIS = $(TARGET_OUT:.out=.dis) TARGET_SYM = $(TARGET_OUT:.out=.sym)