Build & Load: STM32
Build and load programs on STM32 without debugging
Overview
This document describes how to build, load, and run RTK-based programs for the Cortex-M33 STM32 series of MCUs without debugging.
-
Tested with STM32U585 and STM32H573.
-
The native binary file format is ELF, both with or without debugging.
-
make-elf creates the ELF file.
-
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
.iniconfig files are needed with the correct address ranges, and the framework provides the STM32-specific modules. -
Other guides:
- debugging: Build, Load & Debug: STM32
- Secure/Non-secure without debugging: Build & Load: STM32 (S/NS)
- Secure/Non-secure with debugging: Build, Load & Debug: STM32 (S/NS)
-
See also Practical Notes.
Steps
1. Compile and Link the Program
Please refer to Compile and Link: STM32.
2. Make the ELF File
make-elf embeds the program binary into an ELF file. No debug data and symbols are generated.
python -m make-elf <program>.bin
make-elf uses configuration data directly from the program's map file, hence no command line options are required.
The ELF file can be inspected using the standard tool readelf. Run readelf -S <program>.elf to list all sections.
3. Load the ELF File
There are two options:
- STM32CubeProgrammer GUI, or
- STM32_Programmer_CLI
3a. STM32CubeProgrammer GUI
- connect via ST-Link (click the botton on top right, green/yellow-ish)
- left hand side, use tab "Memory & File editing"
- new tab => open
<program>.elf - click the blue-ish Download button
- after downloading, press the board reset button to start the program
3b. STM32_Programmer_CLI
STM32_Programmer_CLI.exe -c port=SWD -d <program>.elf -s
STM32_Programmer_CLI uses the on-board ST-Link firmware to connect.
See External Tools how to install the STM32 programmer.
Last updated: 14 May 2026