From 1b5733b4b029a37ade18756909d94ffbc61ea815 Mon Sep 17 00:00:00 2001 From: blckmn Date: Fri, 23 May 2025 20:59:51 +1000 Subject: [PATCH] Build uf2 success with RP2350B - fix strtol duplication --- src/main/common/strtol.c | 2 ++ src/main/target/common_post.h | 4 ++++ src/platform/PICO/mk/PICO.mk | 6 ++++-- src/platform/PICO/platform_mcu.h | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/common/strtol.c b/src/main/common/strtol.c index f94f3fc38d..0739cec593 100644 --- a/src/main/common/strtol.c +++ b/src/main/common/strtol.c @@ -30,6 +30,7 @@ #define _STRTO_ENDPTR 1 +#if PLATFORM_NO_LIBC static unsigned long _strto_l(const char * str, char ** endptr, int base, int sflag) { unsigned long number, cutoff; @@ -127,6 +128,7 @@ unsigned long strtoul(const char * str, char ** endptr, int base) { return _strto_l(str, endptr, base, 0); } +#endif int atoi(const char *str) { diff --git a/src/main/target/common_post.h b/src/main/target/common_post.h index cf35e11de9..7907c9f4cc 100644 --- a/src/main/target/common_post.h +++ b/src/main/target/common_post.h @@ -39,6 +39,10 @@ */ +#ifndef PLATFORM_NO_LIBC +#define PLATFORM_NO_LIBC 1 +#endif + #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) #define DEFAULT_AUX_CHANNEL_COUNT MAX_AUX_CHANNEL_COUNT #else diff --git a/src/platform/PICO/mk/PICO.mk b/src/platform/PICO/mk/PICO.mk index cb7cfd9379..5fe505cb76 100644 --- a/src/platform/PICO/mk/PICO.mk +++ b/src/platform/PICO/mk/PICO.mk @@ -24,7 +24,7 @@ ifeq ($(DEBUG_HARDFAULTS),PICO) CFLAGS += -DDEBUG_HARDFAULTS endif -SDK_DIR = $(LIB_MAIN_DIR)/pico-sdk +SDK_DIR = $(LIB_MAIN_DIR)/pico-sdk/src #CMSIS CMSIS_DIR := $(SDK_DIR)/rp2_common/cmsis/stub/CMSIS @@ -79,6 +79,7 @@ PICO_LIB_SRC = \ rp2_common/pico_float/float_math.c \ rp2_common/hardware_divider/divider.c \ rp2_common/hardware_vreg/vreg.c \ + rp2_common/hardware_xip_cache/xip_cache.c \ rp2_common/pico_standard_binary_info/standard_binary_info.c \ rp2_common/pico_clib_interface/newlib_interface.c \ rp2_common/pico_malloc/malloc.c \ @@ -118,7 +119,7 @@ endif #CMSIS VPATH := $(VPATH):$(CMSIS_DIR)/Core/Include:$(CMSIS_DIR)/Device/$(TARGET_MCU_LIB_UPPER)/Include -CMSIS_SRC := +CMSIS_SRC := INCLUDE_DIRS += \ $(TARGET_PLATFORM_DIR) \ @@ -218,6 +219,7 @@ SYS_INCLUDE_DIRS = \ $(SDK_DIR)/rp2_common/hardware_gpio/include \ $(SDK_DIR)/rp2_common/pico_malloc/include \ $(SDK_DIR)/rp2_common/hardware_timer/include \ + $(SDK_DIR)/rp2_common/hardware_xip_cache/include \ $(CMSIS_DIR)/Core/Include \ $(CMSIS_DIR)/Device/$(TARGET_MCU_LIB_UPPER)/Include \ $(SDK_DIR)/$(TARGET_MCU_LIB_LOWER)/pico_platform/include \ diff --git a/src/platform/PICO/platform_mcu.h b/src/platform/PICO/platform_mcu.h index aa9bdd37c1..80544a0da8 100644 --- a/src/platform/PICO/platform_mcu.h +++ b/src/platform/PICO/platform_mcu.h @@ -30,6 +30,7 @@ #include "hardware/flash.h" #define NVIC_PriorityGroup_2 0x500 +#define PLATFORM_NO_LIBC 0 #if defined(RP2350A) || defined(RP2350B)