|
| 1 | +From fdda5455cffab22425dfe63e614ba91d92de3ca8 Mon Sep 17 00:00:00 2001 |
| 2 | +From: giulcioffi < [email protected]> |
| 3 | +Date: Fri, 13 May 2022 09:59:06 +0200 |
| 4 | +Subject: [PATCH 162/171] RP2040: Fix multiple definitions errors and clashes |
| 5 | + |
| 6 | +--- |
| 7 | + targets/TARGET_RASPBERRYPI/TARGET_RP2040/.mbedignore | 1 + |
| 8 | + .../TARGET_RP2040/pico-sdk/host/boot_stage2.c | 4 +--- |
| 9 | + .../Device/RaspberryPi/RP2040/Source/system_RP2040.c | 2 +- |
| 10 | + .../pico-sdk/rp2_common/pico_runtime/runtime.c | 8 ++++---- |
| 11 | + 4 files changed, 7 insertions(+), 8 deletions(-) |
| 12 | + |
| 13 | +diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/.mbedignore b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/.mbedignore |
| 14 | +index 0581f97d6e..b5d6dbeacf 100644 |
| 15 | +--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/.mbedignore |
| 16 | ++++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/.mbedignore |
| 17 | +@@ -5,6 +5,7 @@ pico-sdk/rp2_common/pico_printf* |
| 18 | + pico-sdk/boards/include/boards/* |
| 19 | + pico-sdk/common/pico_base/include/pico/* |
| 20 | + pico-sdk/rp2_common/boot_stage2/* |
| 21 | ++pico-sdk/rp2_common/pico_bootsel_via_double_reset/* |
| 22 | + pico-sdk/rp2_common/pico_malloc/* |
| 23 | + pico-sdk/rp2_common/pico_stdlib/ |
| 24 | + pico-sdk/rp2_common/pico_mem_ops/* |
| 25 | +diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/host/boot_stage2.c b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/host/boot_stage2.c |
| 26 | +index 52794b155c..cfa374bdb6 100644 |
| 27 | +--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/host/boot_stage2.c |
| 28 | ++++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/host/boot_stage2.c |
| 29 | +@@ -1,3 +1 @@ |
| 30 | +-void main() { |
| 31 | +- |
| 32 | +-} |
| 33 | +\ No newline at end of file |
| 34 | ++// empty |
| 35 | +\ No newline at end of file |
| 36 | +diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/cmsis/stub/CMSIS/Device/RaspberryPi/RP2040/Source/system_RP2040.c b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/cmsis/stub/CMSIS/Device/RaspberryPi/RP2040/Source/system_RP2040.c |
| 37 | +index 055a0752c1..01b4c6d357 100644 |
| 38 | +--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/cmsis/stub/CMSIS/Device/RaspberryPi/RP2040/Source/system_RP2040.c |
| 39 | ++++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/cmsis/stub/CMSIS/Device/RaspberryPi/RP2040/Source/system_RP2040.c |
| 40 | +@@ -33,7 +33,7 @@ |
| 41 | + /*--------------------------------------------------------------------------- |
| 42 | + System Core Clock Variable |
| 43 | + *---------------------------------------------------------------------------*/ |
| 44 | +-uint32_t SystemCoreClock; /* System Clock Frequency (Core Clock)*/ |
| 45 | ++uint32_t SystemCoreClock = 125000000; /* System Clock Frequency (Core Clock)*/ |
| 46 | + |
| 47 | + /*--------------------------------------------------------------------------- |
| 48 | + System Core Clock function |
| 49 | +diff --git a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/pico_runtime/runtime.c b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/pico_runtime/runtime.c |
| 50 | +index 575e23e08b..50920bcad0 100644 |
| 51 | +--- a/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/pico_runtime/runtime.c |
| 52 | ++++ b/targets/TARGET_RASPBERRYPI/TARGET_RP2040/pico-sdk/rp2_common/pico_runtime/runtime.c |
| 53 | +@@ -175,7 +175,7 @@ void runtime_init(void) { |
| 54 | + |
| 55 | + } |
| 56 | + |
| 57 | +-void _exit(__unused int status) { |
| 58 | ++void __exit(__unused int status) { |
| 59 | + #if PICO_ENTER_USB_BOOT_ON_EXIT |
| 60 | + reset_usb_boot(0,0); |
| 61 | + #else |
| 62 | +@@ -214,7 +214,7 @@ void *_sbrk(int incr) { |
| 63 | + |
| 64 | + // exit is not useful... no desire to pull in __call_exitprocs |
| 65 | + void exit(int status) { |
| 66 | +- _exit(status); |
| 67 | ++ __exit(status); |
| 68 | + } |
| 69 | + |
| 70 | + // incorrect warning from GCC 6 |
| 71 | +@@ -225,7 +225,7 @@ void __assert_func(const char *file, int line, const char *func, const char *fai |
| 72 | + failedexpr, file, line, func ? ", function: " : "", |
| 73 | + func ? func : ""); |
| 74 | + |
| 75 | +- _exit(1); |
| 76 | ++ __exit(1); |
| 77 | + } |
| 78 | + |
| 79 | + #pragma GCC diagnostic pop |
| 80 | +@@ -280,7 +280,7 @@ void __attribute__((noreturn)) __printflike(1, 0) panic(const char *fmt, ...) { |
| 81 | + #endif |
| 82 | + } |
| 83 | + |
| 84 | +- _exit(1); |
| 85 | ++ __exit(1); |
| 86 | + } |
| 87 | + #endif |
| 88 | + |
| 89 | +-- |
| 90 | +2.36.0 |
| 91 | + |
0 commit comments