#usb-serial #serial-communication #defmt #jtag #microcontrollers #esp32-s3 #interface

nightly esp-fast-serial

Fast USB serial library for ESP32-S3 and similar chips with the USB-Serial-JTAG peripheral

6 releases

0.3.0 Oct 12, 2024
0.2.4 Aug 24, 2024
0.1.0 Aug 24, 2024

#598 in Hardware support

Download history 426/week @ 2024-08-19 10/week @ 2024-08-26 11/week @ 2024-09-16 5/week @ 2024-09-23 2/week @ 2024-09-30 118/week @ 2024-10-07 36/week @ 2024-10-14 4/week @ 2024-11-04

69 downloads per month

MIT/Apache

21KB
256 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.2.3", 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–16MB
~305K SLoC