Radiation-hardening Miosix
LLVM · STM32 · 2026In orbit, a charged particle can flip a bit in a register or in RAM. That's a single-event upset, and the code keeps running on a wrong value. ASPIS is an LLVM plugin from Politecnico di Milano's HEAPLab that hardens code against this at the IR level. I integrated it into the build of Miosix, an embedded RTOS, so the kernel itself compiles hardened for an STM32F407.
Try it: click any bit of x to hit it with a cosmic ray. EDDI keeps a shadow copy of every value and compares the two before the value is used.
icmp eq x, x′ is true, so execution continues.
- C / C++
- clangemits LLVM IR
- llvm-link
- ASPIS passesEDDI + CFCSS
- codegen
- .elf → .binobjcopy
- STM32F407
- A CMake module that sends any target through the clang → opt → link pipeline and skips assembly files automatically
- Every pass can be picked from the build script: data duplication (
eddi,reddi,seddi,fdsc) and control-flow checking (cfcss,rasm,inter-rasm,racfed) - Compiled the whole kernel through ASPIS, then moved to selective hardening with annotations on the scheduler
- A clang toolchain file that can point at any LLVM install, plus an objcopy step that produces a flashable
.bin