ESP32 USB Stack

Work in Progress
Creating a communication link over USB to send measurements from the root node to host computer.
- Establish connection via TinyUSB stack from ESP32-S3
- Start Serial port listner in C on Linux computer.
- Check the possibility of letting the middleware handle the data sequencing. - Sending it manually would be the way.
Send measurement data from root to host.
- Pack and send measurement data over USB
- Read and parse the data to reconstruct the mesurements in Linux Computer.
Next steps
Resolve issue with ACM0 (Auto detecting the USB port name)
Differentiating between measurements (open and close usb connection)
The max tx packet size seems to be 64 bytes. Hence we will have to chunk down the measurements once again in the root node prior to sending over USB.
Details
ESP32 S series is able to work as a USB device as well as a USB host.
ESP-IDF USB device stack is based on TinyUSB which is a USB stack written for embedded devices.
We are making use of CDC (ACM): Communication Device Class (Abstract Control Model), for sending data.
API calls
tinyusb_cdcacm_write_queuewill hold up upto 64bytes till it is successfully flushed throughtinyusb_cdcacm_write_flushcall. Once the queue is filled it won't accept further bytes.TinyUSB can have issues with synchronous tx and rx. Make sure you don't tx data while expecting rx data.
CONFIG_TASK_WDT_TIMEOUT_S, a setting in menuconfig. Increasing the watchdog timer value can avoid WDT being triggered.