Oberon RTK

Build, Load & Debug: STM32

Build, load, and debug programs on STM32

Overview

This document describes how to build, load, and run RTK-based programs for the Cortex-M33 STM32 series of MCUs for debugging.

  • Tested with STM32U585 and STM32H573.

  • The native binary file format is ELF, both with or without debugging.

  • make-elf creates the ELF file. It creates and embeds the necessary DWARF debug data. Note that the executable binaries are 100% the same with or without debug data, and consequently there is no "debug overhead" with debug data included if run outside a debugger.

  • The suite of tools used is Astrobe for RP2350 – despite its name, at its core it is a compiler and linker for processors based on Cortex-M33, which work well for the STM32U585 and STM32H573. Specific .ini config files are needed with the correct address ranges, and the framework provides the STM32-specific modules.

  • Other guides:

See also Practical Notes.

Prerequisites

The build and debug tools must be set up as explained in:

Steps

Please refer to Compile and Link: STM32.

To continue, the program must build without errors or alerts; warnings are OK.

2. Create the Absolute Assembly Listings

gen-rdb creates an .alst file for each module in the program, plus _startup.alst for the start-up 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

gen-rdb uses configuration data directly from the program's map file, hence no command line options are required.

By default, the .alst files are created in directory rdb in the project directory. To use another directory, please refer to the manual page gen-rdb.

3. Make the ELF File

make-elf embeds the program binary into an ELF file, together with the debug data and symbols generated from the .alst files.

python -m make-elf <program>.bin --debug

make-elf uses configuration data directly from the program's map file.

The ELF file can be inspected using the standard tool readelf. Run readelf -S <program>.elf to list all sections.

4. Load the ELF File

The ELF file is loaded by the debugger:

  • GUI: Cortex-Debug inside Visual Studio Code – see Debugging § VS Code + Cortex-Debug
  • command line: OpenOCD and GDB – see Debugging § GDB Command Line

Last updated: 15 May 2026