-
Notifications
You must be signed in to change notification settings - Fork 1.5k
arch/risc-v/rp23xx-riscv: Add rp23xx(rp2350) (Pico 2 board) RISC-V support #16424
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
Conversation
|
Wow! |
|
@shtirlic amazing! Kudos!!! |
|
Hmm, @shtirlic Output of ./tools/configure.sh from NuttX:
Possibly something to do with the RISCV tool chain I have to install and configure? Any idea? |
|
Okay manually compiled the toolchain with the correct configuration, but as probably expected, this did not make the nuttx configuration work 🤔 |
It's just a warning(not sorted out yet) did you try to make it? Yeah toolchain from aur built with double float, that's why we have to build with soft ABI for Arch. |
|
@keever50 I updated the branch, check pls |
|
@shtirlic Nice, the warnings are gone! How do i make this using the custom built toolchain?
Not entirely sure how it's finding the toolchain, but i might have to change something to make it find the correct (custom) one. |
You should add it to the PATH env something like this |
|
@shtirlic The problem I had was quite simple. Doing make distclean after changing toolchain path fixed the problem. |
|
@shtirlic
As you can see, default is 2k, which is exceeded after enabling some basic debugging or applications in kconfig. Causing crashes without notice. This chip has plenty of memory and I consider that few kB of extra memory usage to prevent headaches worth it. |
|
Update: Remember always do: |
That's perfect thank you! |
bee91f0 to
9d164e5
Compare
|
Updated to recent fixes from arm arch |
|
is this huge patch ready for merging? @shtirlic |
|
@xiaoxiang781216 I am planning to do some testing, docs and will make it ready for review this week. |
|
Update: Added docs, some fixes |
|
Updated docs, made available for review |
Chip name : rp23xx-rv Board name : raspberrypi-pico-2-rv Arch : risc-v Changes from ARM rp23xx impl - Linker script update - ASM head start - Update chip start - New Hazard3 registers - Remove rp23xx chip hw spinlocks/testset - New irq handling (external IRQ interrupt Hazard3) - New timerisr based on RISC-V std MTIME and alarm arch - No SMP yet - Tickless option - Double size for idle, irq and main stacks - Board reset via watchdog trigger Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Big Thank You @shtirlic AMAZING WORK!! =)
Build works flawlessly but I had problems running after flashing. Does the board need additional setup to run generated nuttx.uf2 or this is my local setup problem? I am using picotool 2.2.0 for flashing and this is great fresh tool that was missing not that long ago :-)
% uname -a
FreeBSD hexagon 14.2-RELEASE-p1 FreeBSD 14.2-RELEASE-p1 GENERIC amd64
% git branch
(HEAD detached at shtirlic/riscvrp23xx)
% ./tools/configure.sh -B raspberrypi-pico-2-rv:usbnsh
Copy files
Select CONFIG_HOST_BSD=y
Refreshing...
(..)
#
# configuration written to .config
#
% /usr/bin/time -h gmake -j24
Create version.h
LN: platform/board to /XXX/nuttx-apps.git/platform/dummy
Register: hello
Register: nsh
Register: sh
Register: getprime
Register: dd
Register: ostest
CPP: /XXX/nuttx.git/boards/risc-v/rp23xx-rv/raspberrypi-pico-2-rv/scripts/memmap_default.ld-> XXX
LD: nuttx
riscv32-unknown-elf-ld: warning: /XXX/nuttx.git/nuttx has a LOAD segment with RWX permissions
Memory region Used Size Region Size %age Used
FLASH: 168992 B 4 MB 4.03%
RAM: 14916 B 512 KB 2.85%
SCRATCH_X: 0 B 4 KB 0.00%
SCRATCH_Y: 0 B 4 KB 0.00%
Generating: nuttx.uf2
Done.
6,68s real 34,00s user 14,97s sys
% picotool version
picotool v2.2.0 (FreeBSD, Clang-18.1.6, Release)
% picotool load nuttx.uf2
Family ID 'rp2350-riscv' can be downloaded in absolute space:
00000000->02000000
Loading into Flash: [==============================] 100%
% picotool reboot
The device was rebooted into application mode.
After flashing I get no /dev/cuaUn that should show up. Tried on rPI Pico2 and Pico2W the result is the same. I played with picotool erase etc, also tried to copy nuttx.uf2 to /dev/da0s1.
After some trial and error I made board to show up as:
Aug 10 19:55:46 hexagon kernel: ugen1.12: <NuttX CDC/ACM Serial> at usbus1
Aug 10 19:55:46 hexagon kernel: umodem0 on uhub10
Aug 10 19:55:46 hexagon kernel: umodem0: <NuttX CDC/ACM Serial, class 2/0, rev 2.00/1.01, addr 22> on usbus1
Aug 10 19:55:46 hexagon kernel: umodem0: data interface 1, has CM over data, has break
Then I had only echo on the console.. after some time NuttX prompt showed up.
Not sure if this is indented behavior or my local setup problem, but for sure this is a good starting point for updates :-)
|
@cederom thanks, my bet is that your pico was in arm mode and uf2/picotool not switched the pico board to risc-v cores. I researched the initial boot format that should be in the final firmware file and made it according to the spec, maybe there are some more markers that should force the pico into risc-v mode. Try picotool info on the uf2 file, is it correct? |
|
Thanks @shtirlic yup it looks I need to switch to RISC-V as default somehow :-) The image seems to be correctly created for RV: Loader recognises it as RV: It now worked for some reason :-) And the NuttX shell is here after some time: Then I disconnect, reconnect, and there is no NuttX :-( Maybe a bug in picotool / pico-sdk (using latest release tag 2.2.0 from git clone)? Tested on Pico W and 2W:
|
|
This |
|
@cederom there are some pages in rp2350 datasheet my OTP looks like this, see the BOOT_ARCH bit set to 1 and |
I also found that there is option for |
Maybe |
|
Sorry for the delay @shtirlic I am kinda overloaded.. I have moment to take a look again. Would it be possible to create a dedicated configuration like led-blinker so I can see with bare eyes if the application works? Maybe this is the |

Summary
Add support for RP2350 RISC-V cores, Add Pico 2 board.
Naming
Changes from ARM rp23xx impl
...
Todo
Toolchain
Use RISC-V gnu toolchain with soft float abi. Default riscv-collab uses double float abi
This is config for https://github.com/riscv-collab/riscv-gnu-toolchain
Config
Serial NSH
USB CDC/ACM Serial NSH
Testing
cpuinfo
getprime
ostest nsh output