Skip to content
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

Add RP2350 support #2337

Merged
merged 44 commits into from
Aug 25, 2024
Merged

Add RP2350 support #2337

merged 44 commits into from
Aug 25, 2024

Conversation

earlephilhower
Copy link
Owner

@earlephilhower earlephilhower commented Aug 17, 2024

The PR has been tested on SparkFun, ILabs, and Pico 2 RP2350 boards. Everything is working except for:

  • OTA (I need to understand the new boot setup much better)
  • FreeRTOS (An RPI port exists but is not part of the upstream tree we use and a manual merge will be needed)
  • HSTX not made into a library (TBD in future release)
  • RP2350 optimizations (SHA256, others. Will be added at some point in the future once other stuff working)

(Also, for some reason the one official Pico2 that I have tried OpenOCD on has failed, but the same config works fine on the iLabs RP2350 BConnect so it's either some HW lockout on my sample or a wiring issue on the Pico2 board rev 2624 6.17)

Utilize a platform_inc/wrap and a core_inc/wrap.
lib/ and include/ now are core-specific with chip-specific lib/rp2040 and include/rp2040 dirs.
Cut-n-paste error
Windows and x86 Mac missing.  The build environment got eaten by bitrot.  Will update
before merge...
Commercial boards now only have 1 size PSRAM, no need to have menu for them.
@FeuerSturm
Copy link
Contributor

@earlephilhower
First of all, thanks a lot for all the work you are doing!
Please pardon my lack of knowledge that results in a probably stupid question:
Will all TinyUSB features work right out of the box with this PR for the RP2350, receiving USB HID packets, setting USB vendor and product specifically?

@earlephilhower
Copy link
Owner Author

@FeuerSturm TinyUSB in the Pico-SDK repo works fine. The CDC(serial) works as does HID (I tested the keyboard example, but if 1 works the others are just a different report format). Assuming Adafruit_TinyUSB has moved to the latest version of TinyUSB then it should work as well if that's what you were asking.

@FeuerSturm
Copy link
Contributor

@earlephilhower
Thanks, yes, that was exactly what I was asking.
I am eager to get home tonight and try it out 👍

@earlephilhower
Copy link
Owner Author

Awesome. A quick test of the Adafruit_TinyUSB boot-keyboards and mass storage device examples worked fine on the RP2350, so I believe they're all up to date.

@earlephilhower
Copy link
Owner Author

@Architeuthis-Flux I just noticed the breadboard you sent was also an RP2350 board in disguise!

I haven't looked too deeply into it, but I assume the 2350 actually does the analog mux control and it doesn't really make sense to add a Jumperless RP2350 board to the menus, yes? If the user flashes the board they'll basically lose all the cool functionality and (most importantly) the RGBs!

@Architeuthis-Flux
Copy link

@Architeuthis-Flux I just noticed the breadboard you sent was also an RP2350 board in disguise!

I haven't looked too deeply into it, but I assume the 2350 actually does the analog mux control and it doesn't really make sense to add a Jumperless RP2350 board to the menus, yes? If the user flashes the board they'll basically lose all the cool functionality and (most importantly) the RGBs!

I've spent the last few days getting all the firmware to run all the Jumperless 23(V5)0 stuff on a single core (I was using core 1 for the LEDs and sending data to the crossbar switches, but it doesn't really need all that), so I can leave the other one completely free to run arbitrary user code. So yes, it would be amazing to add Jumperless to Arduino-pico's menu. Next step is for me to write an abstraction layer to treat it as just another dev board. It'll be stretching the concept of a typical board definition, being single core with 10 GPIO, 6 (+-8V shifted) ADCs, 4 (+-8V) power supplies, 2 current sensors, a probe, 445 addressable LEDs (making a weirdly spaced 14x30 display), and the ability to route all that stuff anywhere.

I'd be happy to keep the latest version of the firmware accessible in a convenient format somewhere so it can be pulled like any other library, and generally do whatever it takes to make life easy for you and Jumperless users.

btw, what I sent you is an OG Jumperless which runs on an RP2040. As soon as the latest Jumperless V5 prototypes with the R2350B get in, you will have one. But take your time, it'll take about a month.

@arturo182
Copy link
Contributor

Would greatly appreciate it if you could also merge #2352 after this PR but before making a release, thanks!

@earlephilhower earlephilhower merged commit 33694a1 into master Aug 25, 2024
20 checks passed
@earlephilhower earlephilhower deleted the split branch August 25, 2024 18:40
@lyusupov
Copy link
Contributor

lyusupov commented Aug 26, 2024

Core 4.0.1

Pico 2 build ( with arduino-cli ) still uses ARDUINO_ARCH_RP2040 architecture definition:

image

Is this an intentional quirk ?

@earlephilhower
Copy link
Owner Author

Yes, that's the "Arduino core architecture." To identify which variant, use the SDK's #if defined(PICO_RP2350) define.

@lyusupov
Copy link
Contributor

lyusupov commented Aug 26, 2024

Ok.
However, ARDUINO_ARCH_RP2350 is also in use in some places to identify the Pico 2. And this fact looks confusing....

image

@earlephilhower
Copy link
Owner Author

Ah, that's probably a bug I made and only in the platform.io stuff. Good catch. I'll update that back to the ARCH_RP2040 define.

@earlephilhower
Copy link
Owner Author

#2361 to fix

@zackees
Copy link

zackees commented Aug 29, 2024

Hi, I'm a dev at FastLED. Trying to add RP2350 support for FastLED, do you know what I'm doing wrong?

image

This is the board json I'm injecting into ~/.platformio

https://github.com/FastLED/FastLED/blob/master/ci/boards/rpipico2.json

@earlephilhower
Copy link
Owner Author

Just a quick note, that JSON was copied from the 4.0.1 release which unfortunately had the Pico2 @ 133 instead of 150MHz. You probably want to pull the latest version of it so you don't leave performance on the table.

What is the error message you're getting?

I don't use P.IO, but do you need to actually specify the board=rpipico2 somewhere? If it's the dict key, rpico2 should be rpipico2.

@maxgerhardt would be the expert here on getting the Pico2 running. He might need to update his platform-rpi library to pull in the latest tools (esp. picotool which is now mandatory but before was unused).

@zackees
Copy link

zackees commented Aug 30, 2024

I had a mismatch between the different names. I've fixed that on my end and now i'm waiting for a new compile

@zackees
Copy link

zackees commented Aug 30, 2024

Okay, it made it to the next build failure.... digging in..

rp2350

@zackees
Copy link

zackees commented Aug 30, 2024

this is my platformio.ini file:

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:rpipico2]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico2
framework = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Aug 30, 2024

You're not following my guidance at all with the platformio.ini from FastLED/FastLED#1673 (comment). framework = arduino has to be given and the updated package as platform_packages = framework-arduinopico@https://github.com/earlephilhower/arduino-pico.git.

I'll fix up the PlatformIO platform then you can test as normal without fancy package updates.

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Aug 30, 2024

FYI, dual-core Cortex-M33 on RP2350 is working great in PlatformIO: maxgerhardt/platform-raspberrypi#69 (comment).

@zackees
Copy link

zackees commented Aug 30, 2024

Thanks, added your suggestion, see FastLED/FastLED@57b7481

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.