š ļø Lightweight logging & debugging crate for embedded Rust (no_std friendly)
dvcdbg is a lightweight, no_std-friendly logging and debugging library for embedded Rust. It is designed to simplify the initial setup and bring-up of new hardware by providing a convenient set of diagnostic tools.
⨠Key Features
- ā
Works in
no_stdenvironments - ā Lightweight and fast, formatless logging support
- ā
Includes useful embedded utilities:
- I2C bus scanner (
scan_i2c!) - Hex dump (
write_hex!) - Execution cycle measurement (
measure_cycles!)
- I2C bus scanner (
- ā
Quick diagnostic workflow with
quick_diag! - ā Serial logger abstraction for various HALs
- ā
Feature flags allow selective compilation:
loggerā logging utilitiesscannerā I2C scanning utilitiesmacrosā helper macros (impl_fmt_write_for_serial!,quick_diag!, etc.)
š¦ Quickstart
š Usage Example (Arduino)
use default_serial;
use *;
Architecture

š Macros Included
impl_fmt_write_for_serial!ā implementcore::fmt::Writefor any serial typewrite_hex!ā print byte slices in hexadecimal formatmeasure_cycles!ā measure execution cycles or timestampsloop_with_delay!ā loop with fixed delay for testingassert_log!ā log assertions without panickingscan_i2c!ā scan I²C bus for connected devicesquick_diag!ā all-in-one diagnostic workflow
š Documentation
š Binary Size Optimisation
Since dvcdbg is designed for a no_std environment, it is important to minimise the final binary size.
Enabling LTO (link-time optimisation) and strip during release builds will remove unused code from dvcdbg and other dependent crates, significantly reducing the binary size.
Add the following settings to your application's Cargo.toml.
# Cargo.toml (application)
[]
= true
= true
š ļø Supported Environments
- Rust
no_std - AVR (Arduino Uno)
- ESP-IDF / other HALs supported via serial abstraction
š¤ Contributing
Bug reports, feature suggestions, and pull requests are welcome! See CONTRIBUTING.md for guidelines.
š License
MIT OR Apache-2.0