Show HN: Micro-RLE ≤264-byte compression for UART/MCU logs, zero RAM growth
5 months ago
- #UART
- #MCU
- #compression
- 264-byte stream compressor with drift-aware RLE-XOR reduces MCU UART bandwidth by half.
- Flash usage: 252 B (M4) / 264 B (M0+) at -Os -mthumb -nostdlib.
- RAM usage: 36 B state (no heap, no initialized data).
- Compression rate: 33-70% on typical data using RLE + XOR delta with escape.
- Timing: 6-14 cycles/byte deterministic.
- Boot time: < 600 µs @ 24 MHz.
- Lossless compression with full 8-bit delta support via escape sequence.
- Function sizes: log_byte (196 B), log_init (30 B), log_flush (24 B), emit (2 B).
- Total footprint: 252 B flash, 36 B RAM.
- Token format: [run:3][delta:5].
- Escape mechanism for large deltas (> 0x1F) with minimal overhead.
- Drift observation window (WIN=32) and constants tuned for 115200 bps serial @ 24 MHz.
- Receiver should ignore consecutive STUFF_BYTE markers.
- MIT License with no warranty; thorough testing recommended before production use.
- Contributions welcome for bug fixes, documentation, test cases, and platform-specific examples.