Compile and Link: RP2040
Compile and link RTK-based programs for RP2040
Overview
This document describes how to compile and link RTK-based programs for RP2040. The process is the same without or with debugging.
After compilation and linking, the next steps will be:
- without debugging: Build & Load: RP2040
- with debugging: Build, Load & Debug: RP2040
Compile and Link
-
Tested with Astrobe for RP2040, v10.0.2.
-
Programs can be built using
-
the Astrobe IDE, or
-
the Astrobe command line programs
- AstrobeCompile
- AstrobeLink
- AstrobeBuild
-
-
A complete build runs AstrobeBuild then AstrobeLink:
-
AstrobeBuild recursively compiles a module together with every module it imports; modules are only compiled as needed;
-
AstrobeLink produces the binaries and the map.
-
In the IDE, both steps are combined via menu Project > Build or Project > Rebuild.
-
-
Refer to the corresponding documentation for instructions.
-
The build process produces the following main files:
<program>.bin: raw binary<program>.uf2: the raw binary encoded in UF2 format<program>.map: human-readable data about modules and address ranges- for each module:
<module>.smb: symbol file<module>.arm: relocatable object file<module>.lst: listing file (source and assembly code, in the relocatable stage, that is, before addresses are resolved)
-
Usage:
<program>.uf2can be loaded onto the RP2040; it cannot contain DWARF debug data.<program>.binis the basis for creating an ELF file, which is the file format used to include DWARF debug data.<program>.mapis used by various utility programs to extract data about the program.<module>.lstare used as basis to create<module>.alstfiles, which form the basis to extract DWARF debug data.
-
The command line programs are used in build scripts. On Windows, they are located in the Astrobe program installation directory. For macOS, see Astrobe on macOS.
Configuration Files
Configuration files for Astrobe (.ini) contain two major blocks (among other data):
- code and data address ranges
- the library search path
The configuration files provided in the repository are in:
<repo>/config/astrobe-rp2040/pico-rp2040-vXY, withXYbeing the library version.
Address Ranges
These are the commonly used address ranges as used by most test and example programs.
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| Code | 10000100H | 10200000H | ~2 MB | Flash (XIP) |
| Data | 20000000H | 20030000H | 192 kB | SRAM |
In this set-up, 64k of the RP2040's 256k main SRAM are reserved for the Core1 program; they are allocated via the corresponding start-up module MemMap. Any distribution among the cores is possible.
Library Search Path
The library search path in your configuration files depends on the installation of Oberon RTK. It must include all relevant directories of Oberon RTK, as well as Astrobe's own framework.
Last updated: 12 May 2026