Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add defmt documentation #540

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion cargo-espflash/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- omit in toc -->
# cargo-espflash

[![Crates.io](https://img.shields.io/crates/v/cargo-espflash?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/cargo-espflash)
Expand All @@ -8,6 +9,7 @@ Cross-compiler and Cargo extension for flashing Espressif devices.

Supports the **ESP32**, **ESP32-C2/C3/C6**, **ESP32-H2**, **ESP32-S2/S3**, and **ESP8266**.

<!-- omit in toc -->
## Table of Contents

- [Installation](#installation)
Expand All @@ -17,7 +19,8 @@ Supports the **ESP32**, **ESP32-C2/C3/C6**, **ESP32-H2**, **ESP32-S2/S3**, and *
- [Bootloader and Partition Table](#bootloader-and-partition-table)
- [Package Metadata](#package-metadata)
- [Configuration File](#configuration-file)
- [Configuration examples](#configuration-examples)
- [Configuration Examples](#configuration-examples)
- [Logging Format](#logging-format)
- [License](#license)
- [Contribution](#contribution)

Expand Down Expand Up @@ -148,6 +151,17 @@ vid = "303a"
pid = "1001"
```

## Logging Format

`cargo-espflash` `flash` and `monitor` subcommands support several logging formats using the `-L/--log-format` argument:
- `serial`: Default logging format
- `defmt`: Uses [`defmt`] logging framework. With logging format, logging strings have framing bytes to indicate that they are `defmt` messages.
- See [`defmt` section] of `esp-println` readme.
- For a detailed guide on how to use `defmt` in the `no_std` ecosystem, see [`defmt` project] of Embedded Rust (no_std) on Espressif book.

[`defmt` section]: https://github.com/esp-rs/esp-println?tab=readme-ov-file#defmt
[`defmt` project]: https://esp-rs.github.io/no_std-training/03_6_defmt.html

## License

Licensed under either of:
Expand Down
36 changes: 24 additions & 12 deletions espflash/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- omit in toc -->
# espflash

[![Crates.io](https://img.shields.io/crates/v/espflash?labelColor=1C2C2E&color=C96329&logo=Rust&style=flat-square)](https://crates.io/crates/espflash)
Expand All @@ -9,20 +10,20 @@ A library and command-line tool for flashing Espressif devices.

Supports the **ESP32**, **ESP32-C2/C3/C6**, **ESP32-H2**, **ESP32-S2/S3**, and **ESP8266**.

<!-- omit in toc -->
## Table of Contents

- [espflash](#espflash)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
- [Permissions on Linux](#permissions-on-linux)
- [Windows Subsystem for Linux](#windows-subsystem-for-linux)
- [Cargo Runner](#cargo-runner)
- [Using `espflash` as a Library](#using-espflash-as-a-library)
- [Configuration File](#configuration-file)
- [Configuration Examples](#configuration-examples)
- [License](#license)
- [Contribution](#contribution)
- [Installation](#installation)
- [Usage](#usage)
- [Permissions on Linux](#permissions-on-linux)
- [Windows Subsystem for Linux](#windows-subsystem-for-linux)
- [Cargo Runner](#cargo-runner)
- [Using `espflash` as a Library](#using-espflash-as-a-library)
- [Configuration File](#configuration-file)
- [Configuration Examples](#configuration-examples)
- [Logging Format](#logging-format)
- [License](#license)
- [Contribution](#contribution)

## Installation

Expand Down Expand Up @@ -157,6 +158,17 @@ vid = "303a"
pid = "1001"
```

## Logging Format

`espflash` `flash` and `monitor` subcommands support several logging formats using the `-L/--log-format` argument:
- `serial`: Default logging format
- `defmt`: Uses [`defmt`] logging framework. With logging format, logging strings have framing bytes to indicate that they are `defmt` messages.
- See [`defmt` section] of `esp-println` readme.
- For a detailed guide on how to use `defmt` in the `no_std` ecosystem, see [`defmt` project] of Embedded Rust (no_std) on Espressif book.

[`defmt` section]: https://github.com/esp-rs/esp-println?tab=readme-ov-file#defmt
[`defmt` project]: https://esp-rs.github.io/no_std-training/03_6_defmt.html

## License

Licensed under either of:
Expand Down