-
Notifications
You must be signed in to change notification settings - Fork 431
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 RISC-V support #2491
Add RISC-V support #2491
Conversation
|
The runtime init array was being dropped due to linker differences in GCC14.2, leading to the chip not actually initting USB or other clocks (among other things). Manually force them into the array. PWMAudio, Blink, and Fade work.
|
2506047
to
dc6e33f
Compare
dc6e33f
to
e9ccdd1
Compare
8ff1fc8
to
2f350b0
Compare
7c5bc02
to
ba11f8b
Compare
ba11f8b
to
f41fd9f
Compare
|
Not actually used by the ROM any more, so save the few bytes
3d7ddeb
to
bfa085a
Compare
This PR's pretty good to go. I'm still not sure it'll be part of the mainstream, but other than the GCC update and a fix to locking, no ARM-related changes were done so it shouldn't actually have any negative impact on the main platform. Platform.IO runs will fail until it starts pointing to the new GCC 14.2 toolchain. @maxgerhardt any suggestions? Any way of using different tools programmatically? RISC-V/ARM can be selected through the menus and most things "just work" under RISC-V. Known issues are OTA and some FreeRTOS-related USB stuff not fully implemented. A new toolchain, GCC 14.2, is required since RISC-V support in 12.4 is not usable, so |
I'm working on the PIO integration right now. Some things stand out:
|
The toolchain URLs and toolchain switch was implemented (see commits/develop/). The examples all build now again, for RP2040, RP2350 ARM + RISC-V. Users can switch to the RISC-V build with ; RP2350 based (ARM)
[env:rpipico2]
board = rpipico2
; RP2350 based (RISC-V)
[env:rpipico2-riscv]
board = rpipico2
board_build.mcu = rp2350-riscv It's still weird because the RISC-V build still builds the regular boot2.S file and it works, LED blinking and all. (I have not yet synced the PIO board JSON changes). How does that work here? Does the RISC-V build not need a boot2 file to integrate with the external flash chip? Also, why do we need special board definitions for RP2350 boards when in RISC-V mode? ( |
Thanks!
The boot2 isn't actually used anywhere on the RP2350. On the 2040 ROM they called a specific address where it lived and it was responsible for setting up the QSPI interface. On the 2350 the ROM has add'l intelligence which they say get you running "good enough" with whatever flash. If the app wants to adjust the QSPI timing/etc. then it can do so itself programmatically. We don't. The boot2 files were just being added to the binary image but never accessed.
A leftover, dropped from the latest pushes. It was a board before, now it's just a build option...
Will do next build. Also going to try and reduce the R5 GCC image size because it now includes every R5 architecture option...it's a 3hr/32 parallel job/200GB monster now, though, so might be next week when the new files get up there. |
Can you clear the cache for PlatformIO in the Githu actions once per https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#viewing-cache-entries? It's still using the old platform version and with it the old toolchain, that's why compiling fails. |
52e2b5c
to
9b2bb37
Compare
@maxgerhardt , the toolchain 4.0.1 was rebuilt and uploaded with the fixes JSON entries and smaller d/l and install sizes. When you update the P.IO wrapper let me know and I'll blow away the 4.0.0 one. |
How does a PlatformIO end user with an RP2350 board go about designating that the compile / upload should use RISC-V rather than Arm Cortex M33? |
Tools were updated to 4.0.1 in maxgerhardt/platform-raspberrypi@a7eddaa Full ; common settings
[env]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
framework = arduino
; RP2040 based
[env:pico]
board = rpipico
[env:picow]
board = rpipicow
; RP2350 based (ARM)
[env:rpipico2]
board = rpipico2
; RP2350 based (RISC-V)
[env:rpipico2-riscv]
board = rpipico2
board_build.mcu = rp2350-riscv |
This PR's pretty good to go. I'm still not sure it'll be part of the mainstream, but other than the GCC update and a fix to locking, no ARM-related changes were done so it shouldn't actually have any negative impact on the main platform.
Platform.IO runs will fail until it starts pointing to the new GCC 14.2 toolchain. @maxgerhardt any suggestions? Any way of using different tools programmatically?
RISC-V/ARM can be selected through the menus and most things "just work" under RISC-V. Known issues are OTA and some FreeRTOS-related USB stuff not fully implemented.
A new toolchain, GCC 14.2, is required since RISC-V support in 12.4 is not usable, so git clones need to do a get.py to install. This also will increase tool installation size since both ARM and RISCV compiler chains are needed.