7 unstable releases (3 breaking)
0.5.0 | Dec 1, 2024 |
---|---|
0.3.0 | Oct 12, 2024 |
0.2.4 | Aug 24, 2024 |
0.1.0 | Aug 24, 2024 |
#309 in Hardware support
135 downloads per month
21KB
255 lines
esp-fast-serial
Fast serial communication for ESP32-S3 and similar microcontrollers that has a built-in USB Serial JTAG interface.
Features
- Much faster than the default
esp-println
implementation. - Uses the built-in USB Serial JTAG interface.
- No need for external hardware.
- Provides a fast concurrent
defmt
printer. - Provides a direct write function for ASCII/raw data alongside
defmt
logging. - Provides a custom halt function that allows reflashing without disconnecting the USB cable.
Limitations
- Only supports
defmt
messages that are less than 2048 bytes.- This is due to the current implementation of the "global" logger.
- As
defmt
messages cannot be interleaved, we have to make a global buffer to store the full message. - It is possible to create your own local logger that can handle larger messages.
- Currently only supports the S3 and the C6
Usage
Add the following to your Cargo.toml
:
[dependencies]
esp-fast-serial = { version = "0.5.0", features = ["esp32s3"] }
Then, in your main.rs
:
spawner.spawn(esp_fast_serial::serial_comm_task(peripherals.USB_DEVICE));
// After the task created the serial I/O, you can get the handle to the RX queue
let reader = esp_fast_serial::reader_take();
License
MIT OR Apache-2.0
Dependencies
~9–17MB
~310K SLoC