From e73680df343105f266d77d9aba2496811534b553 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 10 Nov 2023 15:37:19 +0100 Subject: [PATCH 01/12] docs: Add documentation --- src/lib.rs | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 713d6f2..0eb2ad6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,66 @@ +//! A library that provides `print!`, `println!`, `dbg!` implementations and +//! logging capabilities for Espressif devices. +//! +//! - Supports all Espressif devices. +//! - Supports different communication methods: +//! - UART (Default) +//! - JTAG-Serial (Only available in ESP32-C3, ESP32-C6, ESP32-H2, ESP32-S3) +//! - [RTT] +//! - No-op: Turns printing into a no-op +//! - Supports [`defmt`] backend +//! +//! # Using `esp-println` as a Library: +//! +//! ```toml +//! esp-println = { version = "0.7.0", features = ["esp32c2"] } +//! ``` +//! or `cargo add esp-println --features esp32c2` +//! +//! Its important to specify your target as feature. +//! +//! # Features +//! +//! - There is one feature for each supported target: `esp32`, `esp32c2`, +//! `esp32c3`, `esp32c6`, esp32h2`, `esp32s2`, `esp32s3` and `esp8266`. +//! - One of these features must be enabled. +//! - Only one of these features can be enabled at a time. +//! - There is one feature for each supported communication method: `uart`, +//! `jtag-serial` and `rtt` `no-op`. +//! - Only one of these features can be enabled at a time. +//! - `critical-section` enables critical sections. +//! - `colors` enable colored output. +//! - There is one feature for each [`defmt` supported encoding]: +//! - `defmt`: Uses [rzCOBS] encoding +//! - `defmt-raw`: Raw data, that no encoding. +//! +//! ## Default Features +//! +//! By default, we use the `uart`, `critial-section` and `colors` features. +//! Which means that it will print to the UART, use critical sections and output +//! messages will be colored. +//! +//! If we want to use a communication method that is not `uart`, the default +//! one, we need to [disable the default features]. +//! +//! # `esp-backtrace` +//! +//! `esp-println` is usually used alongside [`esp-backtrace`]. When using this +//! two crates together, make sure to use the same communication methods for +//! both dependencies. Table matching features: +//! +//! | `esp-println` | `esp-backtrace` | +//! | ------------- | -------------------- | +//! | `uart` | `print- uart` | +//! | `jtag-serial` | `print- jtag-serial` | +//! | `rtt` | `print- rtt` | +//! +//! [`defmt`]: https://github.com/knurling-rs/defmt +//! [`defmt` supported encoding]: https://defmt.ferrous-systems.com/encoding.html?highlight=rzcobs#encoding +//! [rzCOBS]: https://github.com/Dirbaio/rzcobs +//! [rtt]: https://crates.io/crates/espflash +//! [disable the default features]: https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature +//! [`esp-backtrace`]: https://github.com/esp-rs/esp-backtrace + #![no_std] #[cfg(any(feature = "defmt-espflash", feature = "defmt-raw"))] From 07e6bfaa94aaf99755d34c845b2340865976ab89 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Fri, 10 Nov 2023 15:50:33 +0100 Subject: [PATCH 02/12] Fix matching features table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dániel Buga --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0eb2ad6..abad06c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,9 +50,9 @@ //! //! | `esp-println` | `esp-backtrace` | //! | ------------- | -------------------- | -//! | `uart` | `print- uart` | -//! | `jtag-serial` | `print- jtag-serial` | -//! | `rtt` | `print- rtt` | +//! | `uart` | `print-uart` | +//! | `jtag_serial` | `print-jtag-serial` | +//! | `rtt` | `print-rtt` | //! //! [`defmt`]: https://github.com/knurling-rs/defmt //! [`defmt` supported encoding]: https://defmt.ferrous-systems.com/encoding.html?highlight=rzcobs#encoding From 2334e4099d826c827f38f2e94807abfcf53b7444 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Fri, 10 Nov 2023 15:50:58 +0100 Subject: [PATCH 03/12] Update defmt encodings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dániel Buga --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index abad06c..3da786a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,8 +30,8 @@ //! - `critical-section` enables critical sections. //! - `colors` enable colored output. //! - There is one feature for each [`defmt` supported encoding]: -//! - `defmt`: Uses [rzCOBS] encoding -//! - `defmt-raw`: Raw data, that no encoding. +//! - `defmt`: Uses [rzCOBS] encoding and adds framing. This is intended to be used with `espflash` +//! - `defmt-raw`: Raw defmt output without additional framing. //! //! ## Default Features //! From d9b2b3057da7d69be4e0977e141010f0ad50473a Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 10 Nov 2023 15:55:12 +0100 Subject: [PATCH 04/12] docs: Add espflash link --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 3da786a..502b66a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,7 +30,9 @@ //! - `critical-section` enables critical sections. //! - `colors` enable colored output. //! - There is one feature for each [`defmt` supported encoding]: -//! - `defmt`: Uses [rzCOBS] encoding and adds framing. This is intended to be used with `espflash` +//! - `defmt`: Uses [rzCOBS] encoding and adds framing. This is intended to +//! be used with [`espflash`] (See `-L/--log-format` argument of `flash` or +//! `monitor` subcommands of `espflash` and `cargo-espflash`) //! - `defmt-raw`: Raw defmt output without additional framing. //! //! ## Default Features @@ -57,6 +59,7 @@ //! [`defmt`]: https://github.com/knurling-rs/defmt //! [`defmt` supported encoding]: https://defmt.ferrous-systems.com/encoding.html?highlight=rzcobs#encoding //! [rzCOBS]: https://github.com/Dirbaio/rzcobs +//! [`espflash`]: https://github.com/esp-rs/espflash //! [rtt]: https://crates.io/crates/espflash //! [disable the default features]: https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature //! [`esp-backtrace`]: https://github.com/esp-rs/esp-backtrace From 73a4f6f88294efcfa518f1e47985dcfbb5da1ff4 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 10 Nov 2023 16:27:55 +0100 Subject: [PATCH 05/12] docs: Address feedback --- README.md | 104 ++++++++++++++++++++++++++++++++++++++--------------- src/lib.rs | 67 +--------------------------------- 2 files changed, 77 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index a281988..630d863 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,58 @@ # esp-println -Provides `print!`, `println!` and `dbg!` implementations for various Espressif devices. - -- Supports ESP32, ESP32-C2/C3/C6, ESP32-H2, ESP32-S2/S3, and ESP8266 -- Dependency free (not even depending on `esp-hal`, one optional dependency is `log`, another is `critical-section`) -- Supports JTAG-Serial output where available -- Supports RTT (lacking working RTT hosts besides _probe-rs_ for ESP32-C3 and ESP32-C6) -- `no-op` features turns printing into a no-op - -## Usage - -In your `Cargo.toml`, under `[dependencies]`, add: - -``` -cargo add esp-println --features esp32 +A library that provides `print!`, `println!`, `dbg!` implementations and +logging capabilities for Espressif devices. +- Supports all Espressif devices. +- Supports different communication methods: + - UART (Default) + - JTAG-Serial (Only available in ESP32-C3, ESP32-C6, ESP32-H2, ESP32-S3) + - [RTT] + - No-op: Turns printing into a no-op +- Supports [`defmt`] backend + +# Usage + +```toml +esp-println = { version = "0.7.0", features = ["esp32c2"] } ``` - -Replace `esp32` with your target, if necessary. +or `cargo add esp-println --features esp32c2` +It's important to specify your target device as feature. Then in your program: -``` +```rust use esp_println::println; ``` You can now `println!("Hello world")` as usual. +# Features + +- There is one feature for each supported target: `esp32`, `esp32c2`, + `esp32c3`, `esp32c6`, `esp32h2`, `esp32s2`, `esp32s3` and `esp8266`. + - One of these features must be enabled. + - Only one of these features can be enabled at a time. +- There is one feature for each supported communication method: `uart`, + `jtag-serial` and `rtt` `no-op`. + - Only one of these features can be enabled at a time. +- `log`: Enables logging using [`log` crate] +- `critical-section` enables critical sections. +- `colors` enable colored output. +- There are two ways to use this library with [`defmt`]: + - `defmt`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash` + Uses [rzCOBS] encoding and adds framing. + - `defmt-raw`: Raw defmt output without additional framing. ⚠️ Be careful when using this feature: you must only write + output using `defmt` macros, or you may irrecoverably corrupt the output stream! This means that even the bootloader's output + must be disabled. + +## Default Features + +By default, we use the `uart`, `critial-section` and `colors` features. +Which means that it will print to the UART, use critical sections and output +messages will be colored. +If we want to use a communication method that is not `uart`, the default +one, we need to [disable the default features]. + ## Logging With the feature `log` activated you can initialize a simple logger like this @@ -35,7 +62,7 @@ init_logger(log::LevelFilter::Info); There is a default feature `colors` which enables colored log output. -Additionally you can use +Additionally, you can use ```rust init_logger_from_env(); ``` @@ -44,29 +71,50 @@ In this case the following environment variables are used: - `ESP_LOGLEVEL` sets the log level, use values like `trace`, `info` etc. - `ESP_LOGTARGETS` if set you should provide the crate names of crates (optionally with a path e.g. `esp_wifi::compat::common`) which should get logged, separated by `,` and no additional whitespace between -If this simple logger implementation isn't sufficient for your needs you can implement your own logger on top of `esp-println` - see https://docs.rs/log/0.4.17/log/#implementing-a-logger +If this simple logger implementation isn't sufficient for your needs, you can implement your own logger on top of `esp-println`. See [Implementing a Logger section log documentaion] -## defmt +## `defmt` Using the `defmt-espflash` feature, esp-println will install a defmt global logger. The logger will output to the same data stream as `println!()`, and adds framing bytes so it can be used even with other, non-defmt output. Using the `defmt` feature automatically uses the Rzcobs encoding and does not allow changing the encoding. -You can also use the `defmt-raw` feature that allows using any encoding provided by defmt, but -does not add extra framing. Using this feature requires some care as the defmt output may become -unrecoverably mangled when other data are printed. +You can also use the `defmt-raw` feature that allows using any encoding provided by `defmt`, but +does not add extra framing. Using this feature requires some care as the `defmt` output may become +unrecoverably mangled when other data is printed. + +Follow the [`defmt` book's setup instructions] on how to +set up `defmt`. Remember, the global logger is already installed for you by `esp-println`! + +# `esp-backtrace` + +`esp-println` is usually used alongside [`esp-backtrace`]. When using this +two crates together, make sure to use the same communication methods for +both dependencies. Table matching features: +| `esp-println` | `esp-backtrace` | +| ------------- | ------------------- | +| `uart` | `print-uart` | +| `jtag_serial` | `print-jtag-serial` | +| `rtt` | `print-rtt` | -Follow the [defmt book's setup instructions](https://defmt.ferrous-systems.com/setup) on how to -set up defmt. Remember, the global logger is already installed for you by esp-println! +[`defmt`]: https://github.com/knurling-rs/defmt +[`log` crate]: https://github.com/rust-lang/log +[rzCOBS]: https://github.com/Dirbaio/rzcobs +[`espflash`]: https://github.com/esp-rs/espflash +[rtt]: https://wiki.segger.com/RTT +[disable the default features]: https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature +[`esp-backtrace`]: https://github.com/esp-rs/esp-backtrace +[Implementing a Logger section log documentaion]: https://docs.rs/log/0.4.17/log/#implementing-a-logger +[`defmt` book's setup instructions]: https://defmt.ferrous-systems.com/setup -### Troubleshooting linker errors +# Troubleshooting linker errors If you experience linker errors, make sure you have *some* reference to `esp_println` in your code. If you don't use `esp_println` directly, you'll need to add e.g. `use esp_println as _;` to your import statements. This ensures that the global logger will not be removed by the compiler. -## License +# License Licensed under either of: @@ -75,7 +123,7 @@ Licensed under either of: at your option. -### Contribution +# Contribution Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without diff --git a/src/lib.rs b/src/lib.rs index 502b66a..6a21fbc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,69 +1,4 @@ -//! A library that provides `print!`, `println!`, `dbg!` implementations and -//! logging capabilities for Espressif devices. -//! -//! - Supports all Espressif devices. -//! - Supports different communication methods: -//! - UART (Default) -//! - JTAG-Serial (Only available in ESP32-C3, ESP32-C6, ESP32-H2, ESP32-S3) -//! - [RTT] -//! - No-op: Turns printing into a no-op -//! - Supports [`defmt`] backend -//! -//! # Using `esp-println` as a Library: -//! -//! ```toml -//! esp-println = { version = "0.7.0", features = ["esp32c2"] } -//! ``` -//! or `cargo add esp-println --features esp32c2` -//! -//! Its important to specify your target as feature. -//! -//! # Features -//! -//! - There is one feature for each supported target: `esp32`, `esp32c2`, -//! `esp32c3`, `esp32c6`, esp32h2`, `esp32s2`, `esp32s3` and `esp8266`. -//! - One of these features must be enabled. -//! - Only one of these features can be enabled at a time. -//! - There is one feature for each supported communication method: `uart`, -//! `jtag-serial` and `rtt` `no-op`. -//! - Only one of these features can be enabled at a time. -//! - `critical-section` enables critical sections. -//! - `colors` enable colored output. -//! - There is one feature for each [`defmt` supported encoding]: -//! - `defmt`: Uses [rzCOBS] encoding and adds framing. This is intended to -//! be used with [`espflash`] (See `-L/--log-format` argument of `flash` or -//! `monitor` subcommands of `espflash` and `cargo-espflash`) -//! - `defmt-raw`: Raw defmt output without additional framing. -//! -//! ## Default Features -//! -//! By default, we use the `uart`, `critial-section` and `colors` features. -//! Which means that it will print to the UART, use critical sections and output -//! messages will be colored. -//! -//! If we want to use a communication method that is not `uart`, the default -//! one, we need to [disable the default features]. -//! -//! # `esp-backtrace` -//! -//! `esp-println` is usually used alongside [`esp-backtrace`]. When using this -//! two crates together, make sure to use the same communication methods for -//! both dependencies. Table matching features: -//! -//! | `esp-println` | `esp-backtrace` | -//! | ------------- | -------------------- | -//! | `uart` | `print-uart` | -//! | `jtag_serial` | `print-jtag-serial` | -//! | `rtt` | `print-rtt` | -//! -//! [`defmt`]: https://github.com/knurling-rs/defmt -//! [`defmt` supported encoding]: https://defmt.ferrous-systems.com/encoding.html?highlight=rzcobs#encoding -//! [rzCOBS]: https://github.com/Dirbaio/rzcobs -//! [`espflash`]: https://github.com/esp-rs/espflash -//! [rtt]: https://crates.io/crates/espflash -//! [disable the default features]: https://doc.rust-lang.org/cargo/reference/features.html#the-default-feature -//! [`esp-backtrace`]: https://github.com/esp-rs/esp-backtrace - +#![doc = include_str!("../README.md")] #![no_std] #[cfg(any(feature = "defmt-espflash", feature = "defmt-raw"))] From 379d9315ed108807080a0bdd75b458237d658177 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 10 Nov 2023 16:40:21 +0100 Subject: [PATCH 06/12] feat: Verify that colors is used with log --- build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.rs b/build.rs index fedef0d..e1c4f68 100644 --- a/build.rs +++ b/build.rs @@ -43,4 +43,9 @@ fn main() { "The `jtag_serial` feature is only supported by the ESP32-C3, ESP32-C6, ESP32-H2, and ESP32-S3" ); } + + // Ensure that, if the `colors` is used with `log`.` + if cfg!(feature = "colors") && !cfg!(feature = "log") { + panic!("The `colors` feature is only effective when using the `log` feature"); + } } From 25c83aa388a990bb1c754f1ef3ac36b77864302e Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 10 Nov 2023 16:40:34 +0100 Subject: [PATCH 07/12] docs: Document that colors must be used with log --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 630d863..f469ab5 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,10 @@ You can now `println!("Hello world")` as usual. - There is one feature for each supported communication method: `uart`, `jtag-serial` and `rtt` `no-op`. - Only one of these features can be enabled at a time. -- `log`: Enables logging using [`log` crate] +- `log`: Enables logging using [`log` crate]. +- `colors` enable colored logging. + - Only effective when using the `log` feature. - `critical-section` enables critical sections. -- `colors` enable colored output. - There are two ways to use this library with [`defmt`]: - `defmt`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash` Uses [rzCOBS] encoding and adds framing. From 1fc4fca837e23084d05640e7ed11c542f7efdce9 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Wed, 15 Nov 2023 09:01:38 +0100 Subject: [PATCH 08/12] fix: Rename feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dániel Buga --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f469ab5..9278d59 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ If this simple logger implementation isn't sufficient for your needs, you can im Using the `defmt-espflash` feature, esp-println will install a defmt global logger. The logger will output to the same data stream as `println!()`, and adds framing bytes so it can be used even with -other, non-defmt output. Using the `defmt` feature automatically uses the Rzcobs encoding and does +other, non-defmt output. Using the `defmt-espflash` feature automatically uses the Rzcobs encoding and does not allow changing the encoding. You can also use the `defmt-raw` feature that allows using any encoding provided by `defmt`, but From fee777e78a5669365a51c5f7bedbc5501f9efc0a Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Wed, 15 Nov 2023 09:01:48 +0100 Subject: [PATCH 09/12] fix: Rename feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Dániel Buga --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9278d59..0de8e65 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ You can now `println!("Hello world")` as usual. - Only effective when using the `log` feature. - `critical-section` enables critical sections. - There are two ways to use this library with [`defmt`]: - - `defmt`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash` + - `defmt-espflash`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash` Uses [rzCOBS] encoding and adds framing. - `defmt-raw`: Raw defmt output without additional framing. ⚠️ Be careful when using this feature: you must only write output using `defmt` macros, or you may irrecoverably corrupt the output stream! This means that even the bootloader's output From 3a37ff3b7b0b56ed25d4ec90a5b6e189cde323b3 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 15 Nov 2023 10:20:20 +0100 Subject: [PATCH 10/12] docs: Mention probe-rs --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0de8e65..622285c 100644 --- a/README.md +++ b/README.md @@ -40,12 +40,16 @@ You can now `println!("Hello world")` as usual. - Only effective when using the `log` feature. - `critical-section` enables critical sections. - There are two ways to use this library with [`defmt`]: - - `defmt-espflash`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash` + - `defmt-espflash`: This is intended to be used with [`espflash`], see `-L/--log-format` argument of `flash` or `monitor` subcommands of `espflash` and `cargo-espflash`. Uses [rzCOBS] encoding and adds framing. - `defmt-raw`: Raw defmt output without additional framing. ⚠️ Be careful when using this feature: you must only write output using `defmt` macros, or you may irrecoverably corrupt the output stream! This means that even the bootloader's output must be disabled. + `defmt` features can also be used with [`probe-rs`]. + +[`probe-rs`]: https://probe.rs/ + ## Default Features By default, we use the `uart`, `critial-section` and `colors` features. From c2c8cfe31cf59d1cf3466813977af77c3a3f67b2 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Arcos Date: Wed, 15 Nov 2023 15:21:04 +0100 Subject: [PATCH 11/12] feat: Update colors message to warning Co-authored-by: Jesse Braham --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index e1c4f68..d5555a5 100644 --- a/build.rs +++ b/build.rs @@ -46,6 +46,6 @@ fn main() { // Ensure that, if the `colors` is used with `log`.` if cfg!(feature = "colors") && !cfg!(feature = "log") { - panic!("The `colors` feature is only effective when using the `log` feature"); + println!("cargo:warning=The `colors` feature is only effective when using the `log` feature"); } } From c15545b9b9b2692365ec7573c5e5ec3658fcd3ac Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Wed, 15 Nov 2023 15:26:18 +0100 Subject: [PATCH 12/12] style: Update format --- build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index d5555a5..564120e 100644 --- a/build.rs +++ b/build.rs @@ -46,6 +46,8 @@ fn main() { // Ensure that, if the `colors` is used with `log`.` if cfg!(feature = "colors") && !cfg!(feature = "log") { - println!("cargo:warning=The `colors` feature is only effective when using the `log` feature"); + println!( + "cargo:warning=The `colors` feature is only effective when using the `log` feature" + ); } }