Raspberry Pi bare metal Dashboard Software written in Rust, fully compatible with TunerStudio/MegaSquirt .dash and .gauge formats.
LibreDash is a bare metal dashboard application for Raspberry Pi written in Rust that runs directly on the hardware without an operating system. It is designed to display TunerStudio/MegaSquirt dashboards exactly as they appear in TunerStudio and Shadow Dash, providing a dedicated, high-performance dashboard display for automotive ECU tuning and monitoring.
- Pure Rust Implementation: Safe, modern systems programming with Rust
- TunerStudio Compatible: Full support for TunerStudio .dash and gauge formats
- INI Gauge Parser: Reads gauge configurations from mainController.ini files
- Authentic Rendering: Gauges render exactly like TunerStudio/Shadow Dash
- Multiple Gauge Styles:
- Horizontal bar gauges
- Vertical bar gauges
- Circular needle gauges (analog)
- Digital numeric displays
- Color-Coded Thresholds: Automatic green/yellow/red coloring based on warning/danger zones
- Bare Metal Performance: Runs directly on Raspberry Pi hardware (no OS overhead)
- No Standard Library: Uses
#![no_std]for minimal footprint - Framebuffer Graphics: Hardware-accelerated display output
- Real-time Updates: Smooth animation and value updates
- Rust toolchain (stable or nightly)
rust-srccomponentllvm-tools-previewcomponent
Install Rust from rustup.rs, then install components:
rustup component add rust-src llvm-tools-previewUse the provided build script:
./build.shOr build manually:
cargo build --release
rust-objcopy --strip-all -O binary target/aarch64-rpi/release/libredash kernel8.imgThis will generate kernel8.img which can be copied to your Raspberry Pi SD card.
- Format an SD card as FAT32
- Copy the following Raspberry Pi firmware files to the SD card:
bootcode.binstart.elffixup.datconfig.txt(optional, for configuration)
- Copy the compiled
kernel8.imgto the SD card - Insert the SD card into your Raspberry Pi and power it on
- Raspberry Pi 3 Model B/B+
- Raspberry Pi 4 Model B (may require config.txt adjustments)
- Display output via HDMI
LibreDash is designed to be a drop-in replacement for TunerStudio/Shadow Dash displays.
LibreDash reads gauge definitions from TunerStudio INI files (mainController.ini):
[GaugeConfigurations]
tachometer = rpm, "Engine Speed", "RPM", 0, 8000, 300, 600, 7000, 7500, 0, 0Format: name = var, "title", "units", lo, hi, loD, loW, hiW, hiD, vd, ld
- name: Internal gauge identifier
- var: Variable from ECU OutputChannels
- title: Display title on gauge
- units: Units label (e.g., "RPM", "PSI", "°F")
- lo/hi: Scale minimum/maximum
- loD/loW: Low danger/warning thresholds
- hiW/hiD: High warning/danger thresholds
- vd: Value decimal places
- ld: Label decimal places
LibreDash supports all standard TunerStudio gauge styles:
- Horizontal Bar: Classic left-to-right fill gauge
- Vertical Bar: Bottom-to-top fill gauge
- Circular/Analog: Needle gauge with arc scale
- Digital: Large numeric display with color-coded border
Gauges automatically change color based on thresholds:
- Green: Normal operating range
- Yellow: Warning zone (approaching limits)
- Red: Danger zone (critical values)
The TunerStudio .dash file is a binary format that includes:
- Dashboard layout coordinates
- Gauge positions and sizes
- Gauge style selections
- Embedded fonts and images
- Background graphics
Status: LibreDash currently parses INI gauge configurations. Full binary .dash parsing is in development. See example.ini for the supported gauge configuration format.
See example.ini for a complete sample INI file with various gauge types:
[GaugeConfigurations]
; Engine gauges
tachometer = rpm, "Engine Speed", "RPM", 0, 8000, 300, 600, 7000, 7500, 0, 0
oil_pressure = oilPressure, "Oil Pressure", "PSI", 0, 100, 10, 20, 80, 90, 1, 0
coolant_temp = coolantTemp, "Coolant Temp", "°F", 0, 250, 50, 80, 220, 240, 0, 0
; Speed and performance
speed = vehicleSpeed, "Speed", "MPH", 0, 200, 0, 0, 180, 190, 0, 0
boost = boostPressure, "Boost", "PSI", -15, 30, -5, 0, 25, 28, 1, 0
; Fuel system
afr = airFuelRatio, "Air/Fuel Ratio", "AFR", 10, 20, 10.5, 12, 16, 18, 2, 1src/main.rs- Main kernel entry point and demosrc/boot.rs- ARM64 boot code and initializationsrc/framebuffer.rs- Framebuffer initialization and drawing primitivessrc/dashboard.rs- Dashboard rendering and element managementsrc/mmio.rs- Memory-mapped I/O operationslinker.ld- Linker script for memory layoutaarch64-rpi.json- Custom target specification for Raspberry Pi.cargo/config.toml- Cargo build configuration
The project uses a modular Rust architecture:
- MMIO Layer (
mmio.rs): Low-level hardware access via memory-mapped I/O - Framebuffer Layer (
framebuffer.rs): Graphics primitives and display management - Dashboard Layer (
dashboard.rs): High-level dashboard element rendering - Application Layer (
main.rs): Main kernel with dashboard setup and animation loop
All code runs in #![no_std] mode without the Rust standard library, using only core library features.
The codebase follows Rust best practices for embedded/bare metal development:
- Uses
#![no_std]and#![no_main]attributes - Custom panic handler (infinite loop)
- Inline assembly for boot code
- Volatile memory operations for MMIO
- Type-safe abstractions over hardware
While some unsafe code is necessary for hardware access, it's isolated to:
- MMIO operations (memory-mapped I/O)
- Framebuffer buffer access
- Boot assembly code
This project is licensed under the GNU General Public License v2.0. See LICENSE file for details.
Contributions are welcome! Please feel free to submit issues and pull requests.
- Raspberry Pi documentation and community
- Rust embedded working group
- ARM architecture reference materials
- Bare metal programming resources