Skip to content

Pico-blink-sdk support for RP2350 #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 7, 2024
Merged

Pico-blink-sdk support for RP2350 #58

merged 5 commits into from
Sep 7, 2024

Conversation

iCMDdev
Copy link
Contributor

@iCMDdev iCMDdev commented Aug 29, 2024

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, guiding swiftc to use the relevant target based on the PICO_PLATFORM CMake variable (which, if not set by the user, is automatically set based on PICO_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.

@iCMDdev iCMDdev changed the title Pico-blink support for RP2350 with pico-sdk Pico-blink-sdk support for RP2350 Aug 29, 2024
@iCMDdev
Copy link
Contributor Author

iCMDdev commented Aug 29, 2024

Just to clarify, I tested this on a Pico 2 with the pico-sdk 2.0.0.

As I already said, I had some issues when compiling for the RP2040 with the new 2.0.0 sdk. However, these PR changes do not break compatibility with RP2040 themselves, and it continues to work as expected with previous SDK versions.

@rauhul
Copy link
Collaborator

rauhul commented Sep 7, 2024

Sorry about the delay on reviewing this PR. It looks great! Do you have any ideas on how we can organize the pico examples to be more clear about what devices are supported overall?

@rauhul rauhul merged commit 22f2c98 into apple:main Sep 7, 2024
@iCMDdev
Copy link
Contributor Author

iCMDdev commented Sep 8, 2024

Thanks for reviewing and merging this!

Do you have any ideas on how we can organize the pico examples to be more clear about what devices are supported overall?

Hmm... I'm not sure. On one hand, Raspberry Pi themselves advertise the new RP2350 as being compatible with RP2040 software, so, when someone sees "Raspberry Pi Pico" they could assume it works on the new chips as well.

Perhaps a solution would be to use the terms "Raspberry Pi Pico series" / "Raspberry Pi Pico, Pico 2", "Pico (RP2040)" / "Pico (RP2040 only)", and "Pico 2 (RP2350)".

On the other hand, using longer terms might not be that great. Perhaps another option would be to add further details in each example's README and leave the "platform" column as it is (looking at it right now, it still gives you a pretty good idea of what boards are supported).

Regarding adding further details in each README, here's an example for pico-blink-sdk.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants