Oberon RTK

Your First Scripted Build

RTK-specific knowledge for your first scripted build on RP2350 (S/NS)

Overview

This page is a short companion to the S/NS build pages: it collects the RTK-specific knowledge you need before your first scripted build on RP2350.

Familiarity with Astrobe and with Your First Build is assumed.

Scripted builds are where you leave the Astrobe IDE: a project-local .cmd (or .sh) script orchestrates Astrobe and the framework's Python tools (sec-epilogue, gen-secure, make-elf) end-to-end. RTK uses scripted builds for any workflow Astrobe can't drive alone – for now that means Secure/Non-secure (S/NS) programs.

Read this page first, then follow these guides:

The running example throughout is the Secure example program at <repo>/examples/v3.1/rpi/pico2/Secure (no partition table). The partition-table variant is at <repo>/examples/v3.1/rpi/pico2/SecurePart.

We use RP2350 as example here; the guides for STM32 are:

Build Scripts Are Project Artefacts

Unlike Astrobe's IDE, which runs from a central installation, scripted builds use a build-elf.cmd (Windows) or build-elf.sh (macOS / Git Bash) that lives in your project directory, alongside the source. The script is part of the project – you copy it from an example, adjust the module and .ini paths to your program, and keep it under version control with the rest.

The simplest starting point is to copy an example project wholesale:

  • <repo>/examples/v3.1/rpi/pico2/Secure/ (no partition table)
  • <repo>/examples/v3.1/rpi/pico2/SecurePart/ (with partition table)

Each contains build-elf.cmd, gen-secure.cfg, and sec/ and nonsec/ directories with the per-side .mod, .ini, and supporting files. Strip down to the modules you actually need, then edit build-elf.cmd so the S_INI, NS_INI, S_MOD, NS_MOD, etc. variables match your renamed files.

Running the Script

The script assumes you run it from the project root and that the RTK_* environment variables are set (see Set-up: Build Scripts on RP). Open a terminal, cd to the project directory, and invoke:

On Windows (cmd):

build-elf.cmd

On macOS or Git Bash:

./build-elf.sh

If the script fails immediately with a message like RTK_ASTROBE_BUILD_2350 not set, you haven't finished Set-up: Build Scripts on RP – and don't forget the close-and-relaunch step (variables set via setx don't reach already-running terminals).

Output goes to sec/S.elf and nonsec/NS.elf. The script terminates on the first failed step, so a clean run means everything worked.

Loading the Two ELF Files

Both the Secure ELF (sec/S.elf) and the Non-secure ELF (nonsec/NS.elf) must be flashed; the S image is the bootable one (carries the IMAGE_DEF block) and brings up the NS image at start-up. See Build & Load: RP2350 (S/NS) § Load the ELF Files for the picotool commands – both with-partition and without-partition cases are covered.

Last updated: 21 May 2026