Skip to content

Commit

Permalink
Compiles and links
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Nov 27, 2024
1 parent a852f67 commit 9a622ff
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Sming/Arch/Rp2040/Components/rp2040/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ SDK_INTERFACES := \
rp2_common/pico_int64_ops \
rp2_common/pico_float \
rp2_common/pico_flash \
rp2_common/pico_mem_ops \
rp2_common/pico_multicore \
rp2_common/pico_platform_compiler \
rp2_common/pico_platform_panic \
Expand Down Expand Up @@ -137,7 +138,8 @@ EXTRA_LIBS += \
RP2040_CMAKE_OPTIONS := \
-G Ninja \
-DCMAKE_MAKE_PROGRAM=$(NINJA) \
-DCMAKE_BUILD_TYPE=$(if $(subst 1,,$(PICO_DEBUG)),RelWithDebInfo,Debug)
-DCMAKE_BUILD_TYPE=$(if $(subst 1,,$(PICO_DEBUG)),RelWithDebInfo,Debug) \
-DPICO_VARIANT=$(RP_VARIANT)

ifeq ($(ENABLE_CCACHE),1)
RP2040_CMAKE_OPTIONS += \
Expand Down
19 changes: 19 additions & 0 deletions Sming/Arch/Rp2040/Components/rp2040/pico-sdk.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
diff --git a/lib/cyw43-driver b/lib/cyw43-driver
--- a/lib/cyw43-driver
+++ b/lib/cyw43-driver
@@ -1 +1 @@
-Subproject commit cf924bb04c8984675ca0fc2178f082e404e048c3
+Subproject commit cf924bb04c8984675ca0fc2178f082e404e048c3-dirty
diff --git a/src/rp2_common/pico_crt0/rp2040/memmap_default.ld b/src/rp2_common/pico_crt0/rp2040/memmap_default.ld
index 5125401..6ba0d2f 100644
--- a/src/rp2_common/pico_crt0/rp2040/memmap_default.ld
Expand All @@ -10,4 +16,17 @@ index 5125401..6ba0d2f 100644
+ __flash_binary_end = .;
} > FLASH

/* stack limit is poorly named, but historically is maximum heap ptr */
diff --git a/src/rp2_common/pico_crt0/rp2350/memmap_default.ld b/src/rp2_common/pico_crt0/rp2350/memmap_default.ld
index bce316d..05c1beb 100644
--- a/src/rp2_common/pico_crt0/rp2350/memmap_default.ld
+++ b/src/rp2_common/pico_crt0/rp2350/memmap_default.ld
@@ -269,7 +269,7 @@ SECTIONS

.flash_end : {
KEEP(*(.embedded_end_block*))
- PROVIDE(__flash_binary_end = .);
+ __flash_binary_end = .;
} > FLASH =0xaa

/* stack limit is poorly named, but historically is maximum heap ptr */
4 changes: 3 additions & 1 deletion Sming/Arch/Rp2040/Components/rp2040/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
cmake_minimum_required(VERSION 3.12)

if (PICO_RP2350)
if (PICO_VARIANT STREQUAL "rp2350")
set(PICO_COMPILER "pico_arm_cortex_m33_gcc")
set(PICO_PLATFORM "rp2350-arm-s")
else()
set(PICO_COMPILER "pico_arm_cortex_m0plus_gcc")
set(PICO_PLATFORM "rp2040")
endif()

set(CMAKE_C_STANDARD 11)
Expand Down
3 changes: 3 additions & 0 deletions Sming/Arch/Rp2040/Components/rp2040/sdk/pico_bit_ops.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
RUNTIME_INIT_FUNC += \
__aeabi_bits_init


ifeq ($(SMING_SOC),rp2040)
WRAPPED_FUNCTIONS += \
__clzsi2 \
__clzdi2 \
__ctzsi2 \
__ctzdi2 \
__popcountsi2 \
__popcountdi2
endif
2 changes: 2 additions & 0 deletions Sming/Arch/Rp2040/Components/rp2040/sdk/pico_divider.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# pico_divider

ifeq ($(SMING_SOC),rp2040)
WRAPPED_FUNCTIONS += \
__aeabi_idiv \
__aeabi_idivmod \
__aeabi_ldivmod \
__aeabi_uidiv \
__aeabi_uidivmod \
__aeabi_uldivmod
endif
6 changes: 5 additions & 1 deletion Sming/Arch/Rp2040/Components/rp2040/sdk/pico_float.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RUNTIME_INIT_FUNC += \
__aeabi_float_init

ifeq ($(SMING_SOC),rp2040)
WRAPPED_FUNCTIONS += \
__aeabi_fadd \
__aeabi_fdiv \
Expand All @@ -27,7 +28,10 @@ WRAPPED_FUNCTIONS += \
__aeabi_f2uiz \
__aeabi_f2ulz \
__aeabi_f2d \
sqrtf \
sqrtf
endif

WRAPPED_FUNCTIONS += \
cosf \
sinf \
tanf \
Expand Down
2 changes: 2 additions & 0 deletions Sming/Arch/Rp2040/Components/rp2040/sdk/pico_mem_ops.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RUNTIME_INIT_FUNC += \
__aeabi_mem_init

ifeq ($(SMING_SOC),rp2040)
WRAPPED_FUNCTIONS += \
memcpy \
memset \
Expand All @@ -12,3 +13,4 @@ WRAPPED_FUNCTIONS += \
__aeabi_memset4 \
__aeabi_memcpy8 \
__aeabi_memset8
endif
2 changes: 0 additions & 2 deletions Sming/Arch/Rp2040/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ CPPFLAGS += \

ifeq ($(SMING_SOC),rp2350)
RP_VARIANT = rp2350
PICO_PLATFORM = rp2350
CPPFLAGS += \
-mcpu=cortex-m33 \
-march=armv8-m.main+fp+dsp \
-DPICO_RP2350
else
RP_VARIANT = rp2040
PICO_PLATFORM = rp2040
CPPFLAGS += \
-mcpu=cortex-m0plus \
-march=armv6-m \
Expand Down

0 comments on commit 9a622ff

Please sign in to comment.