SoCcentric
Open-source MCU firmware · STM32 family

Lyra

Open-source firmware platform for STM32 microcontrollers.

MIT-licensed STM32 foundation with a signed A/B bootloader, five C and Rust reference apps, hardware validation, and factory tooling. MIT licensed.

MIT licensedSTM32 familyReference: NUCLEO-F767ZI10 reposBare-metal · FreeRTOS · Zephyr

Why Lyra exists

After 25+ years in embedded systems (10+ in consulting), we kept rebuilding the same groundwork on every client project: signed A/B bootloaders, field updates, RTOS setup, diagnostics, and factory tooling.

Lyra packages that foundation cleanly for STM32 microcontrollers—signed A/B bootloader, C/Rust apps, validation, and factory tools—so teams reach product features, hardening, and release sooner.

Applications Connected sensors, industrial controllers, and field-updatable MCU products.

Platform overview →
Lyra at a glance
  • SiliconSTM32 microcontrollers, STM32F7 series, STM32F767ZI
  • Reference boardNUCLEO-F767ZI
  • BSPSTM32 HAL · FreeRTOS · Zephyr · Embassy
  • Build targetsNUCLEO-F767ZI (STM32F767ZI)
  • UpdatesSigned A/B bootloader with rollback

Engineering highlights

Fail-safe signed updates

ECDSA P-256 verification before erase and on boot, watchdog trial boot, and rollback after 3 failures.

Five C & Rust apps

Identical reference app across FreeRTOS, Zephyr, and Embassy on one bootloader.

Factory to field

Bench station and factory firmware provision blank boards into updatable units.

Supported hardware

Supported silicon families and the verification reference board. Links open vendor docs.

How it fits together

Four STM32 subsystems: bootloader-gui flashes bootloader, which boots five C/Rust apps in A/B slots; validation-gui drives validation-firmware; and factory-data-gui / factory-station provision via factory-firmware. Hover to trace; click to jump.

Lyra architectureHost and bench tools connect to their STM32 firmware counterparts: bootloader-gui flashes and manages the A/B bootloader; validation-gui drives validation-firmware; factory-data-gui and factory-station provision boards through factory-firmware. The bootloader verifies and boots five C and Rust reference applications across dual A/B flash slots.HOST & BENCH TOOLSON THE MCU · STM32F767ZI (2 MB DUAL-BANK FLASH)SWD / HWLINKHWLINK / UARTCSV / dataST-LINK COMverifies & boots A/Bbootloader-gui↗build, sign, flashvalidation-guiHWVAL Studiofactory-data-gui↗per-unit CSV datafactory-station↗HWVAL Factory benchbootloader↗~28 KB · ECDSA P-256dual-bank A/B slotstrial boot + watchdoganti-rollback countervalidation-firmwareHWVAL · FreeRTOS196 peripheral testsJSON & MD reportsruns in slot A or Bfactory-firmware↗FreeRTOS · slot A manufacturing imagewrites per-unit SYS, CAL, and DIAG recordsanswers bench station over ST-LINK virtual COMhealth supervision and watchdog protectionAPPLICATION SLOTS · 2 × 976 KB (C & RUST REFERENCE APPS)app-c-freertos↗C · FreeRTOSapp-c-zephyr↗C · Zephyrapp-rust-freertos↗Rust · FreeRTOSapp-rust-zephyr↗Rust · Zephyrapp-rust-embassy↗Rust · Embassy (no_std)Dual A/B Flash Slots976 KB × 2 · verified on bootSTM32 HardwareSTM32F767ZI · NUCLEO-F767ZI reference board
Bootloader & hardwareApplications & validationFactory tooling

The repositories

10 public repositories across bootloader, applications, and factory.

Bootloader

Signed A/B bootloader anchoring every Lyra image, paired with its desktop flasher.

bootloader-gui

FlasherPython · updated 24 Nov 2026

Python · PySide6

Desktop utility for building, signing, and flashing bootloader and app images over SWD and UART.

  • Builds and flashes the bootloader over SWD
  • Compiles, signs, and uploads firmware via bootloader
  • Shows slot state, keys, security floor, and USART6 logs

bootloader

BootloaderC · updated 24 Nov 2026

C · bare-metal

Bare-metal STM32 A/B bootloader verifying signatures before erase and on every boot.

  • Two 976 KB dual-bank application slots (~28 KB footprint)
  • ECDSA P-256 verification and non-OTP anti-rollback
  • Watchdog trial boot with rollback after 3 failures

Applications

Five functionally identical C and Rust reference apps across FreeRTOS, Zephyr, and Embassy on the same A/B bootloader.

app-c-freertos

Reference App · CC · updated 25 Nov 2026

C · FreeRTOS

C/FreeRTOS reference demonstrating A/B confirmation, watchdog supervision, and HWLINK.

  • Boots from slot A or B; HWLINK over USART3
  • Health task supervises watchdog and writes CONFIRMED
  • Static allocation only, reproducible Docker build

app-c-zephyr

Reference App · CC · updated 25 Nov 2026

C · Zephyr

C/Zephyr reference aligning devicetree partitions with Lyra's A/B flash map.

  • Devicetree overlay matching dual-slot flash layout
  • Full feature parity with FreeRTOS reference
  • Fault capture to no-init RAM; 128 KB flash / 64 KB RAM gate

app-rust-freertos

Reference App · RustRust · updated 25 Nov 2026

Rust · FreeRTOS

Hybrid no_std Rust application logic on FreeRTOS with minimal C startup and HAL glue.

  • Allocation-free no_std Rust linked with C/HAL objects
  • Full parity across both bootloader slots
  • Watchdog supervision and trial-boot self-confirmation

app-rust-zephyr

Reference App · RustRust · updated 25 Nov 2026

Rust · Zephyr

Rust reference built on Zephyr's official Rust module with minimal C peripheral glue.

  • Native Rust Zephyr threads with thin C hardware glue
  • Captures CPU faults, stack overflows, and panics to no-init RAM
  • Strict rustfmt and clippy checks in CI

app-rust-embassy

Reference App · RustRust · updated 25 Nov 2026

Rust · Embassy

Pure no_std Rust application on the Embassy async executor with HWLINK support.

  • Pure Rust, allocation-free, four async tasks
  • Fixed-buffer FlatBuffers HWLINK at 115200/921600 baud
  • Reset-persistent fault records and pinned Docker toolchain

Factory

Manufacturing bench tools connecting factory-station and factory-data-gui to factory-firmware.

factory-station

Factory StationPython · updated 24 Nov 2026

Python · PySide6

Guided bench app (HWVAL Factory) taking blank boards through provisioning, validation, and registration.

  • Eight bench stages from detect to SYS/CAL/DIAG and validate
  • Generates per-unit payloads from CSV; forward-only registry
  • Built-in board simulator for offline workflow testing

factory-data-gui

Factory DataPython · updated 24 Nov 2026

Python · CLI

Per-unit CSV-to-binary generator for .sys, .cal, and .diag records; core and CLI now merged into factory-station.

  • Defines schemas for per-unit factory data payloads
  • Validates and inspects generated files before flashing
  • Preserved publicly for format reference and history

factory-firmware

Factory FirmwareC · updated 24 Nov 2026

C · FreeRTOS

Slot A manufacturing image communicating with factory-station over ST-LINK COM to write per-unit records.

  • Writes per-unit identity, calibration, and diagnostic maps
  • Reports firmware identity and version to bench station
  • Built on C/FreeRTOS reference with watchdog supervision

Get started

Start with the bootloader. Reference target: STM32F767ZI (container build, SWD flash via ST-LINK).

git clone https://github.com/soccentric-lyra/bootloader.git
cd bootloader
scripts/build.sh     # build in stm32-dev container
make flash           # flash build/boot.elf over SWD
make test            # host, Python, and contract tests

Then flash any C or Rust reference app into slot A or B. Full steps in the bootloader README.

Contribute

Issues, hardware notes, and pull requests are welcome. Target each repository's default branch (master).

License

MIT. Third-party software that the firmware builds against keeps its own licenses.

Need a hand?

Collaborating on STM32

Lyra is MIT-licensed and ready to use on its own. If you need engineering support for custom hardware, peripheral integration, or delivery, we are glad to work with you.

  • Custom STM32 board bring-up
  • Signed A/B boot, rollback, and field updates
  • Drivers, RTOS integration, and factory tooling
  • Architecture reviews through release

SoCcentric · Sandesh Ghimire · 25+ years in embedded systems