rokath/trice
Free🟢 super fast 🚀 tiny 🐥 𝘾 printf-look-and-feel ✍ trace code, in ⚡ interrupts ⚡ too ‼️, and real-time PC 💻 logging 👀
About rokath/trice
Trice is a compact ID-based logging framework for embedded C/C++. Developers use printf-like calls in firmware code, but the target sends only small binary records (a numeric ID plus optional runtime values), drastically reducing FLASH usage, transfer bandwidth, and execution time. The PC-side trice tool reconstructs readable logs using a cumulative til.json file, which preserves old IDs and format strings for backward compatibility. Designed to be super-fast and tiny, Trice can log even from interrupt handlers in a few CPU cycles. It is ideal for scenarios where normal printf logging is too slow, too large, too intrusive, or impractical for field diagnostics.
Key Features
Pros & Cons
- Extremely fast and lightweight footprint
- Safe to use even in interrupt handlers
- Real-time host-side log reconstruction
- Backward compatible with logs from older firmware versions
- Significantly reduces FLASH usage and bandwidth compared to printf
- Requires host-side tool and til.json for decoding logs
- Additional build step ('trice insert') needed to assign IDs
- Not a drop-in replacement for printf in all scenarios
- Debugging without the host tool is not possible