You need to install the Pi Pico SDK; follow this guide to do so.
Prepare your environment by filling PICO_SDK_PATH
with your install location; example:
$ export PICO_SDK_PATH=~/Source/pico-sdk/
Then, build the project with cmake (the following commands target the Pi Pico 2):
$ mkdir build
$ cd build
$ cmake .. -DPICO_PLATFORM=rp2350 -DPICO_BOARD=pico2
$ make
This will eventually create a few interesting outputs:
main.uf2
: this can be loaded directly via USB. Just attach the Pi Pico to your machine while holding down the BOOT button on the board; it should present itself as thumb drive. Copymain.uf2
in the drive to load the firmware.main.elf
: ELF files can be loaded with a debugger. Make sure you have a session of openocd running (for example,openocd -f interface/cmsis-dap.cfg -f target/rp2350.cfg -c "adapter speed 5000"
for the Pi Pico 2); then runarm-none-eabi-gdb main.elf -ex "target extended-remote localhost:3333" -ex "monitor arm semihosting enable" -ex "monitor reset init" -ex "load"
to loadmain.elf
on the board and start a command line debugging session.