Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I added support for running the pico-sdk blink example on RP2350 hardware (using the ARM cores, more on supporting RISC-V below).
Previously, when trying to compile the example for the Pico 2, one may encounter an "invalid instruction" error thrown by
swiftc
. I realized this is due to the architecture differences between RP2040 and RP2350: the former is a Cortex-M30 device using Armv6-M, while the latter is a Cortex-M33 using Armv8-M (but the swift compiler doesn't support it, so armv7em is being used, just as in the pico2-neopixel example (without the SDK)).This pull request changes the project's
CMakeLists.txt
file to automatically account for the target architecture change, guidingswiftc
to use the relevant target based on thePICO_PLATFORM
CMake variable (which, if not set by the user, is automatically set based onPICO_BOARD
).I've also added a target check for RISC-V (since the RP2350 has the option to run the code in RISC-V mode), but for me, compilation fails, showing some errors related to the pico-sdk. I also have some similar errors when compiling for the rp2040 with the new SDK (not exactly the issue described in #49, but changing to previous SDK versions temporarily fixes them).
Edit: the SDK-related RP2040 issue I mentioned is #59.