• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

main/11-Mar-2024-11784

CMakeLists.txtD11-Mar-2024454 108

README.mdD11-Mar-20242.1 KiB6546

README.md

1| Supported Targets | ESP32-S2 | ESP32-S3 |
2| ----------------- | -------- | -------- |
3
4# USB CDC-ACM Host Driver Example
5
6(See the README.md file in the upper level 'examples' directory for more information about examples.)
7
8This example shows how to use the CDC-ACM Host Driver to allow an ESP chip to communicate with a USB CDC-ACM device.
9
10## How to use example
11
12### Hardware Required
13
14Two ESP boards that have USB-OTG supported. One will act as USB host and the other as USB device.
15Connect USB_D+, USB_D-, GND and +5V signals of USB host to USB device.
16
17#### Pin Assignment
18
19See common pin assignments for USB Device examples from [upper level](../../../README.md#common-pin-assignments).
20
21### Build and Flash
22
231. Build and flash [tusb_serial_device example](../../../tusb_serial_device) to USB device board.
242. Build this project and flash it to the USB host board, then run monitor tool to view serial output:
25
26```bash
27idf.py -p PORT flash monitor
28```
29
30(Replace PORT with the name of the serial port to use.)
31
32(To exit the serial monitor, type ``Ctrl-]``.)
33
34See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
35
36## Example Output
37
38After the flashing you should see the output at idf monitor:
39
40```
41I (256) USB-CDC: USB Host installed
42I (256) USB-CDC: Opening CDC ACM device 0x303A:0x4001
43CDC Header Descriptor:
44        bcdCDC: 1.20
45CDC Call Descriptor:
46        bmCapabilities: 0x00
47        bDataInterface: 1
48CDC ACM Descriptor:
49        bmCapabilities: 0x02
50CDC Union Descriptor:
51        bControlInterface: 0
52        bSubordinateInterface[0]: 1
53I (1666) USB-CDC: Data received
54I (1666) USB-CDC: 0x3ffc4c20   41 54 0d                                          |AT.|
55I (2666) USB-CDC: Data received
56I (2666) USB-CDC: 0x3ffc4c20   41 54 2b 47 53 4e 0d                              |AT+GSN.|
57I (3666) USB-CDC: Setting up line coding
58I (3666) USB-CDC: Line Get: Rate: 115200, Stop bits: 0, Parity: 0, Databits: 8
59I (3666) USB-CDC: Line Set: Rate: 9600, Stop bits: 1, Parity: 1, Databits: 7
60I (3666) USB-CDC: Line Get: Rate: 9600, Stop bits: 1, Parity: 1, Databits: 7
61I (3676) Example finished successfully!
62...
63
64```
65