Build RTK-based Programs
How to build RTK-based programs in general.
Overview
This document describes how to build RTK-based programs in general. MCU-specific build, load, and run instructions refer to this guide.
Build
-
Programs can be built using
-
the Astrobe IDE, or
-
the Astrobe command line programs
- AstrobeCompile
- AstrobeLink
- AstrobeBuild
-
-
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)
Astrobe Configuration Files (.ini)
Configuration files contain two major blocks (among other data):
- code and data address ranges
- the library search path
Address Ranges
These are the commonly used address ranges as used by most test and example programs.
RP2040
Single image only (Cortex-M0+, no TrustZone).
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| Code | 10000100H | 10200000H | ~2 MB | flash (XIP) |
| Data | 20000000H | 20030000H | 192 kB | SRAM |
64k of the RP2040's 256k main SRAM are reserved for the Core1 program; they are allocated by the corresponding startup module.
RP2350
Single Image (no S/NS)
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| Code | 10000100H | 10400000H | ~4 MB | flash (XIP) |
| Data | 20000000H | 20040000H | 256 kB | SRAM0-3 |
Code starts at 10000100H to leave 100H for the IMAGE_DEF metadata block prepended by make-uf2. With Astrobe's ImageDef module, code starts at 10000000H.
256k of the RP2350's 512k main SRAM are reserved for the Core1 program; they are allocated by the corresponding startup module.
Dual Image (S/NS) without flash partitions
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| S code | 10000100H | 1007E000H | ~504 kB | flash (XIP) |
| NSC veneers | 1007E000H | 10080000H | 8 kB | flash (XIP) |
| NS code | 10080000H | 10100000H | 512 kB | flash (XIP) |
| S data | 20000000H | 20040000H | 256 kB | SRAM0-3 |
| NS data | 20040000H | 20080000H | 256 kB | SRAM4-7 |
Dual Image (S/NS) with flash partitions
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| S code | 10000100H | 1007E000H | ~504 kB | partition 0 |
| NSC veneers | 1007E000H | 10080000H | 8 kB | partition 0 |
| NS code | 10400000H | 10480000H | 512 kB | partition 1 (translated) |
| S data | 20000000H | 20040000H | 256 kB | SRAM0-3 |
| NS data | 20040000H | 20080000H | 256 kB | SRAM4-7 |
NS code is compiled at the QMI-translated virtual address (10400000H). The S image configures address translation so that the CPU fetches NS code from this range, while the physical flash storage is in partition 1.
STM32U585, STM32H573
Both MCUs use Secure and Non-secure address range aliases.
Single Image (no S/NS)
A single-image program runs as Secure, hence Secure address aliases are used.
| Region | Start | End | Size | MCU | Memory |
|---|---|---|---|---|---|
| Code | 0C000000H | 0C100000H | 1 MB | both | flash (S alias) |
| Data | 30040000H | 300C0000H | 512 kB | U585 | SRAM3 |
| Data | 30050000H | 300A0000H | 320 kB | H573 | SRAM3 |
Dual Image (S/NS) — STM32U585
Both Secure and Non-secure address aliases are used.
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| S code | 0C000000H | 0C0FE000H | ~1016 kB | flash (S alias) |
| NSC veneers | 0C0FE000H | 0C100000H | 8 kB | flash (S alias) |
| NS code | 08100000H | 08180000H | 512 kB | flash (NS alias) |
| S data | 30000000H | 30030000H | 192 kB | SRAM1 (S alias) |
| NS data | 20040000H | 200C0000H | 512 kB | SRAM3 (NS alias) |
Dual Image (S/NS) — STM32H573
Both Secure and Non-secure address aliases are used.
| Region | Start | End | Size | Memory |
|---|---|---|---|---|
| S code | 0C000000H | 0C0FE000H | ~1016 kB | flash (S alias) |
| NSC veneers | 0C0FE000H | 0C100000H | 8 kB | flash (S alias) |
| NS code | 08100000H | 08200000H | 1 MB | flash (NS alias) |
| S data | 30000000H | 30040000H | 256 kB | SRAM1 (S alias) |
| NS data | 20050000H | 200A0000H | 320 kB | SRAM3 (NS alias) |
Note: the NSC veneer addresses are not part of the configuration file.
A Note About the RP2350: IMAGE_DEF
Bootable RP2350 binaries must include an IMAGE_DEF metadata block. Astrobe for RP2350 provides a module ImageDef, which, if imported in module Main, will include that block in the UF2 file. Refer to the Astrobe documentation for further details.
I believe such loading and deployment data should not be part of the program itself: the same binary can be used for different loading scenarios, hence when using make-uf2 the IMAGE_DEF block is prepended to the program binary only before loading – if even needed: non-bootable images such as for Non-secure programs in an S/NS scenario don't require this block.
Note:
- when using module
ImageDef, the linker base address must be10000000H(CodeStartin the.iniconfig file); - when using
make-uf2, the linker base address must be10000100Hto leave100Hprogram memory for the prependedIMAGE_DEFblock.
Last updated: 17 April 2026