-- Views
December 04, 26
スライド概要
Athrill STM32 runs the same PX4 or ArduPilot ELF you flash to a Pixhawk on your PC: no board, no wiring, no rebuild. Version 1.0.0 adds native Windows 11 support (no WSL2), and the same PX4 SIH flight executes exactly 2,904,813,819 instructions with bit-identical results on Windows, macOS and Linux.
This deck covers:
- HITL, SITL and PILS: where Athrill fits, and what it adds to SITL
- RTOS-level emulation: NuttX, ChibiOS and Zephyr, interrupts, DMA and the real sensor drivers run unchanged
- Boards built from Devicetree, with no board code (Pixhawk 4, Pixhawk 6C, Zephyr NUCLEO)
- Bit-identical reproducibility across hosts
- DShot600 ESC emulation, KISS telemetry and motor-failure injection
- JIT and tick skip: about 1.8x faster, same output bits
- The same ArduPilot ELF on Athrill and Renode (about 3.8x), and why a device access is cheap on Athrill
- Choose your physics: Hakoniwa Drone (MuJoCo) or Gazebo
Athrill3 is open source (MIT). If you like it, please Star and Watch on GitHub:
https://github.com/hakoniwalab/athrill-target-stm32
Release article (Japanese): https://hakoniwa-lab.net/2026/12/03/athrill-stm32-v1/
Hakoniwa Lab
TOPPERS/箱庭WG活動でUnityやらAthrillやらmROSやら触ってます。 最近は仕事の関係でWeb系の技術に注力しつつ、箱庭への転用を模索しています。 2023年8月1日:合同会社箱庭ラボに移動しました
RELEASE · 2026-12-03 Athrill STM32 v1.0.0 Fly the unmodified PX4 firmware on your PC, now natively on Windows, macOS and Linux Windows 11 x64 macOS (Apple silicon) Hakoniwa Lab · PX4 Meetup Japan · 2026-12-11 Linux x86_64 (Ubuntu 24.04, WSL2)
An emulated Pixhawk 4 in flight QGroundControl and the PX4 console Athrill3 on your PC Unmodified PX4 v1.17.0 ELF Flight stack, NuttX and sensor drivers Driver reads and writes to device registers Emulated Pixhawk 4 STM32F765, NVIC, DMA, SPI and timers PX4 SIH flight on the emulated board 2
v1.0.0 in four numbers 2,904,813,819 instructions, the same on Windows, macOS and Linux 0 ×1.8 ×3.8 hardware to prepare: no board, wiring or flashing faster with JIT and tick skip, with bit-identical output the speed of Renode, running the same ArduPilot ELF PX4 v1.17.0 and ArduCopter V4.7.2 official binaries · Pixhawk 4, Pixhawk 6C, Zephyr NUCLEO · open source (MIT) 3
As easy to start as SITL, running the real firmware Prepare a board Rebuild for the PC Download and run • Board and wiring • Starts on a PC alone • Starts on a PC alone • Flash the firmware • Needs a PC build of the firmware • Runs the real firmware • RTOS, interrupts, DMA and drivers differ from the board • No rebuild: the published ELF as is • More vehicles, more hardware • Scales to many vehicles • RTOS, interrupts, DMA and drivers run the board's code • Scales, and repeats bit for bit Athrill complements SITL and HITL: it puts the shipping binary on the PC. 4
RTOS, interrupts, DMA and drivers run unchanged What runs SITL Athrill (PILS) Binary Rebuilt for the PC The ELF you flash RTOS scheduling Host OS threads NuttX, ChibiOS, Zephyr as on the board Interrupts, DMA None From NVIC, DMA and timer models Sensor drivers Simulation drivers The real drivers read the chips' registers Time Lockstep with the simulator Virtual clock, 1 instruction = 1 clock; same interrupt order every run Fidelity: register-level functional models at RTOS granularity, not cycles or electrical behaviour. The CPU is Cortex-M7 (Armv7-M, Thumb-2, DSP, FPv5-D16), decoded from Arm's machine-readable architecture data. It does not replace hardware, safety or flight tests. 5
Native Windows: download, unpack, fly • Windows 11 x64, no WSL2 • athrill3.exe links the C runtime and libyaml statically: it needs only WS2_32 and KERNEL32 • Git Bash and Python 3 run the README's Try it: download, checksum, unpack, boot PX4 • QGroundControl connects to TCP 127.0.0.1:5760 • Build guides for macOS, Linux and Windows through the Hakoniwa Business Pack Try it (Git Bash) git clone --branch v1.0.0 \ https://github.com/hakoniwalab/athrill-target-stm32.git . athrill-target-stm32/tools/versions.sh curl -LO "$ATHRILL_RELEASE_URL/$ATHRILL3_DIR.tar.gz" curl -LO "$ATHRILL_RELEASE_URL/px4_fmu-v5_default.elf" curl -L -o SHA256SUMS "$ATHRILL_RELEASE_URL/SHA256SUMS" athrill_sha256 -c --ignore-missing SHA256SUMS tar xzf "$ATHRILL3_DIR.tar.gz" git clone https://github.com/hakoniwalab/athrill-device.git git -C athrill-device checkout -q "$ATHRILL_DEVICE_COMMIT" athrill-target-stm32/examples/px4-sih/run.sh \ px4_fmu-v5_default.elf "$ATHRILL3" 6
Boards: Pixhawk 4, Pixhawk 6C and Zephyr NUCLEO STM32F765 · Cortex-M7 · 216 MHz STM32H743 · Cortex-M7 · 480 MHz NUCLEO-F767ZI / H743ZI Pixhawk 4 Pixhawk 6C NUCLEO • PX4 v1.17.0 (fmu-v5) • PX4 v1.17.0 (fmu-v6c) • Zephyr samples • ArduCopter V4.7.2 (official binary) • ArduCopter V4.7.2 • hello_world, synchronization, philosophers • Flies with SIH, Hakoniwa and Gazebo • Flies with DShot • Flies the Hakoniwa x500 • Board from Zephyr's own board file • DShot ESC and motor failure Emulated sensor chips: ICM-20689, ICM-42688-P, BMI055, MS5611, IST8310, u-blox M8 and more. The firmware's own drivers read their registers. Board photos: PX4 User Guide (CC BY 4.0) and Zephyr Project documentation 7
No board code: one Devicetree builds the board Models that Athrill3 assembles SoC (from Zephyr) stm32f765Xi.dtsi, unchanged USART · UART DTB Devicetree blob Board pixhawk4.dts: sensors, wiring SPI · I2C Firmware the ELF you flash DMA · DMAMUX Timer · PWM NVIC · EXTI SDMMC · F-RAM PX4 · ArduPilot · Zephyr IMU · baro · mag · GPS chips DShot ESC (timer DMA burst) An enabled node without a model stops the boot and names its path. Peripheral models instantiated from the DTB NUCLEO boards include Zephyr's whole nucleo_f767zi.dts: the board a Zephyr application was built for and the board Athrill emulates come from one description. 8
Bit-identical on Windows, macOS and Linux PX4 SIH take-off, hover and landing on each host: different OSes and CPU architectures (Apple silicon and x86_64), the same four results bit for bit. = Instructions = F-RAM 2,904,813,819 the parameter store = = SD card image the whole image, ULog included Console normalized: PX4's NSH output without Athrill's own start-up lines 9
DShot600 ESCs, telemetry and motor failure PX4 / ArduPilot Timer DMA burst Emulated ESC Motor DShot driver packs bits into a DMA buffer writes TIM1 compare registers checks bit rate, duty, CRC, frame gap drops bad frames like a real ESC Telemetry Motor failure KISS telemetry on UART4: temperature, voltage, current, consumption, eRPM. The fault model stops a motor at a chosen time. When a spinning motor's current does not match its throttle for 100 ms, PX4 v1.17 reports "Motor failure detected" by itself. Video (about 5 min): youtube.com/watch?v=XWAsmVYS8bM 10
JIT and tick skip: about 1.8× faster, same bits JIT Each basic block is translated once with sljit and chained. Untranslated instructions, device accesses and exceptions take the interpreter's code. Real-time factor (higher is faster) 4 3.32 3.5 3.52 3 2.5 2 2.30 1.96 1.95 1.5 1.28 Tick skip A device model that does not change in a tick skips it: a timer before its next event, an idle UART or GPIO. Console, F-RAM, SD image, MAVLink bytes and instruction count are the same in all three modes. 1 0.5 0 PX4 v1.17.0 SIH (74.1 virtual s) Interpreter ArduCopter V4.7.2 (80 virtual s) JIT JIT + tick skip 11
Tick skip: tick only the models that can change Without tick skip: every model, every clock Who decides Each model tells Athrill: • Timer: tick me at my next deadline • UART: skip me while idle • GPIO: I never change by myself CPU Timer A register access always asks for a tick. UART GPIO RTF, JIT → JIT + tick skip PX4 SIH 3.32 → 3.52 ArduCopter 1.95 → 2.30 With tick skip: only when it can change CPU Same instructions, same bits Timer UART And when the firmware idles (WFI or b .), the clock jumps straight to the next device event. GPIO firmware write sending a frame compare match virtual clock: 1 instruction = 1 clock CPU executes model ticked model ticked (needed) tick skipped 12
Same ArduPilot ELF: Athrill and Renode One Apple M2 Pro, the same ELF, one IMU on both (Renode --num-imus 1), both halting in the idle loop, virtual 20 s to 80 s. Real-time factor 1.68 → 0.44 s host time per virtual second (Renode → Athrill) Renode (ArduPilot perf branch) Athrill, interpreter Athrill, JIT + tick skip 0.60 0.74 → 0.11 s 1.24 of which, in the device models 2.27 411,627 / 411,873 instructions from reset with the same PC trace 13
Where the host time goes Host seconds per virtual second (shorter is faster) 0 0.2 Renode Athrill, interpreter 0.4 0.6 0.74 0.18 0.8 1 1.2 0.94 0.63 1.4 1.6 1.8 Athrill makes 1.3× as many register accesses 1.01 M against 0.76 M per virtual second, yet it spends less than a quarter of Renode's time in its device models. Renode's emulation thread 44% device models in .NET, 15% setjmp around calls into the CPU library (macOS), 14% guest code, 5% time framework. Not the idle loop: both halt at it (Renode's tlib also treats Thumb b . as WFI). Athrill, JIT + tick skip 0.11 0.33 Device models CPU and everything else 14
Why: two designs, two trade-offs Renode: composed Athrill: monolithic • Device models in C#, CPU in a C library • CPU and devices all in C, one thread • Each register access crosses the language boundary • An access is one function call • Time handed between threads quantum by quantum • One integer clock, 1 instruction = 1 clock: nothing to synchronise 1 Device-heavy firmware: ArduCopter: the language boundary dominates (device models 44%, setjmp 15% of Renode's thread). 2 Mostly-asleep firmware: Zephyr philosophers: 69% of Renode's CPU thread is time synchronisation. About 35 M instructions each: RTF ~10 on Renode, ~430 on Athrill (console transmit time skipped). 3 On top of that: JIT and tick skip cut Athrill's own CPU time from 0.81 s to 0.44 s per virtual second. 15
Why a device access is cheap on Athrill Renode Firmware CPU Peripheral model Back to the CPU LDR / STR to a peripheral tlib, C C#, .NET call guarded by setjmp C → C# boundary ≈ 1.0 µs per access C# → C, setjmp Athrill Firmware CPU Model function LDR / STR to a peripheral C C, same thread Next instruction ≈ 0.1 µs per access one function call Time in the device models ÷ register accesses, per virtual second of the same ArduCopter run: Renode 0.74 s ÷ 0.76 M, Athrill (JIT + tick skip) 0.11 s ÷ 1.01 M. Athrill makes 1.3× as many accesses; the figure includes the models' own work. 16
Choose your physics engine Motor commands Emulated Pixhawk X500 vehicle model PX4 ELF and its sensor drivers MuJoCo or Gazebo IMU, barometer, magnetometer and GPS readings MuJoCo gz-sim Hakoniwa Drone Gazebo • x500 in MuJoCo, as a Hakoniwa asset linked to other simulations and viewers • PX4's Gazebo x500 as is • Or the vehicle inside the Athrill process, for regression tests and tuning • DShot ESC telemetry and motor failure • Take-off and move flown on native Windows or • gz-sim runs inside the Athrill process, on Athrill's virtual time • No gz-transport or ROS in the control path • Flown on macOS and WSL2; native Windows not yet tried 17
Before you flash it Run the firmware you will flash on your PC first, and check not only the control algorithm but the RTOS, interrupts, DMA and sensor drivers. We want to make that kind of development everyday. Athrill3 is open source: please try it. Scan for GitHub If you like it, please ★ Star and Watch on GitHub github.com/hakoniwalab/athrill-target-stm32 Hakoniwa Lab · hakoniwa-lab.net