Skip to content

Building

Val edited this page Nov 17, 2026 · 1 revision

Requirements

  • PlatformIO (CLI or the IDE extension).
  • Python 3 (comes with PlatformIO).

The platform and the GCC cross-compiler are pinned in platformio.ini and installed automatically on the first build. All libraries are in vendor/; nothing is downloaded from package registries.

Build

pio run                              # all four environments
pio run -e recovery -e firmware      # ZT703S only
pio run -e zt706s_recovery -e zt706s_firmware   # ZT706S only
Environment Model Output
recovery ZT703S .pio/build/recovery/OpenOSC-Recovery-ZT703S.ZTK
firmware ZT703S .pio/build/firmware/OpenOSC-Firmware-ZT703S.OSC
zt706s_recovery ZT706S .pio/build/zt706s_recovery/OpenOSC-Recovery-ZT706S.ZTK
zt706s_firmware ZT706S .pio/build/zt706s_firmware/OpenOSC-Firmware-ZT706S.OSC

Each build folder also has firmware.bin and firmware.elf. The firmware .bin carries a board marker and is accepted by Recovery as well. The ZT706S environments extend the ZT703S ones and change only the board.

The version comes from the VERSION file in the repository root.

Board definitions

config/boards/<model>.json is the single source of board parameters used by both C++ and Python. After changing one, regenerate the derived files:

python3 scripts/generate_board_config.py

This updates boards/<model>.json and include/openosc/board/generated/<model>.hpp. The build stops with an error if they are out of date.

Packaging

Script Does
scripts/build.py PlatformIO hook: build flags, board defines, packaging after linking
scripts/package_image.py Wraps the firmware into an .OSC package (1 KiB header, CRC trailer) for Recovery
scripts/bin_to_ztk.py Packs Recovery into the .ZTK container accepted by the device's USB update mode

Installing a build

Copy the .OSC to /openosc/UPDATE/ in Recovery and install it, as described in Updating. Recovery itself is installed like in Installation.

Reproducible builds

The same commit and toolchain produce byte-identical files. Release notes list SHA-256 checksums, so you can compare your build with a release.

Clone this wiki locally