Build and Load: RP2350
Building and loading programs on the RP2350.
Overview
This document describes how to build, load, and run RTK-based programs for the RP2350 for two scenarios:
- simple loading, without debugger
- with debugger
If no debugging is required, UF2 or ELF files can be used; to include DWARF debug data, ELF files are the only option. We'll explain both below.
Note that also without debugging, ELF files can be used for loading. If intended for loading only, you can omit the option --debug when running make-elf. However, it does not hurt if debug data are included in a load-only file, they just increase the load file size. The executable binaries are 100% the same with or without debug data, and consequently there is no "debug overhead" with debug data included.
For programs with Secure/Non-secure segregation refer to Build and Load: RP2350 (S/NS).
See also Practical Notes.
Project Set-up
-
Address ranges: see Build RTK-based Programs.
-
In particular, please pay attention to the section about
IMAGE_DEF. -
For debugging, the additional tools must be installed and configured:
- see section Tools below
- Debugging
Build and Load, no Debugging
Build the Program
1. Build the program
2. Make the UF2 file
> python -m make-uf2 rp2350 <program>.bin
Notes:
-
alternatively use the UF2 file produced by Astrobe, paying attention to the
IMAGE_DEFsection; -
an ELF file made with
make-elf --image-def(without--debug) could also be loaded, withpicotool.
Load the Image
3. Put the RP2350 in BOOTSEL mode, which mounts the virtual volume RP2350
4. Load the UF2 file to the RP2350
-
Without a partition table, use one of these options:
-
use Astrobe's
Run => Uploadmenu command -
copy in the Windows File Explorer or the macOS Finder by drag-and-drop to
RP2350; -
copy from the command line using the OS file copy commands to
RP2350; -
use
picotoolas shown below
-
-
With a partition table (assuming one partition is of type
rp2350-arm-s):- use
picotool
- use
> picotool load <program>.uf2 -v -x
Notes:
-
copying the UF2 file to volume
RP2350with a partition table does not appear to work, but this could be a defect that is rectified by the time you read this -
if the target partition is not of type
rp2350-arm-s, use option-p <partition-no>
Build and Load for Debugging
Build the Program
1. Build: as above
2. Run gen-rdb to create an .alst file for each module in the program, plus _startup.alst for the startup sequence inserted by the linker at the end of the program; make-elf requires the .alst files to create symbols and DWARF debug data:
> python -m gen-rdb <program>.map
3. Make the ELF file
> python -m make-elf <program>.bin --debug --image-def
Notes:
-
both
gen-rdbandmake-elfuse configuration data from the program's map file in this simple one-binary case -
by default, the
.alstfiles are created in directoryrdbin the project directory
Load the Image
4. Load the debug ELF file to the RP2350
-
Refer to Debugging:
- GUI: Cortex-Debug inside VisualStudio Code
- command line: OpenOCD and GDB
- be aware that loading an ELF file via debugger will overwrite any partition table
- hence, follow the attach instructions with a partition table
-
Without partition table:
- use the load debug scenarios in the debuggers
-
With partition table (assuming one partition is of type
rp2350-arm-s):- put the RP2350 in
BOOTSELmode, which mounts the virtual volumeRP2350 - then use
picotoolas outlined below - use the attach debug scenarios in the debuggers
- put the RP2350 in
> picotool load <program>.elf -v -x
Note: if the target partition is not of type rp2350-arm-s, use option -p <partition-no>
Partition Targeting
Any partition can be targeted independent of its type, eg. partition 0:
> picotool load -p 0 <program>.elf -v -x
Tools
- make-uf2
- make-elf
- {ref}gen-rdb`
- External Tools
- Environment Variables
Examples (Repository)
<repo-root>/examples/v3.1/rpi/pico2/SignalSync<repo-root>/examples/v3.1/rpi/pico2/K4base
Last updated: 17 April 2026