Build & Load: RP2040
Build and load programs on RP2040 without debugging
Overview
This document describes how to build, load, and run RTK-based programs for the RP2040 without debugging.
-
Without debugging, the native file format is UF2. ELF binaries without DWARF debug data are an option as well.
-
RP2040 is single-image only (Cortex-M0+, no TrustZone).
-
The boot2 stage-2 loader (256 bytes) is prepended automatically by Astrobe in the UF2 file; no separate step is needed.
-
Other guides:
- debugging: Build, Load & Debug: RP2040
See also Practical Notes.
Steps
1. Compile and Link the Program
Please refer to Compile and Link: RP2040.
As an aside, using make-elf you can also create a non-debug ELF file, for example to keep a build environment focused on one binary file type:
python -m make-elf <program>.bin --boot2
The --boot2 option prepends the boot2 stage-2 loader so the ELF is bootable on flash.
2. Load the Image
2a. Put the RP2040 in BOOTSEL mode, which mounts the virtual volume RPI-RP2.
2b. To Load, 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
RPI-RP2 - copy from the command line using the OS file copy commands to
RPI-RP2 - use
picotool:
picotool load <program>.uf2 -v -x
picotool load <program>.elf -v -x
Last updated: 15 May 2026