Skip to content

Commit

Permalink
docs(usb_host): Update usb_host example READMEs for P4
Browse files Browse the repository at this point in the history
Closes #14578
Closes #12142
  • Loading branch information
tore-espressif committed Oct 31, 2024
1 parent 358e140 commit f7da017
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 44 deletions.
7 changes: 5 additions & 2 deletions examples/peripherals/usb/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# USB-OTG Examples

See the [README.md](../README.md) file in the upper level [examples](../) directory for more information about examples.
See the [README.md](../../README.md) file in the upper level [examples](../../) directory for more information about examples.

## Common Pin Assignments

Pin assignment is only needed for ESP chips that have an USB-OTG peripheral.
Pin assignment is only needed for ESP chips that have a USB-OTG peripheral.
If your board doesn't have a USB connector connected to the USB-OTG dedicated GPIOs, you may have to DIY a cable and connect **D+** and **D-** to the pins listed below.

```
Expand All @@ -21,3 +21,6 @@ Refer to `soc/usb_pins.h` to find the real GPIO number of **USBPHY_DP_NUM** and
| | USB_DP | USB_DM |
| ----------- | ------ | ------ |
| ESP32-S2/S3 | GPIO20 | GPIO19 |
| ESP32-P4 | pin 51 | pin 50 |

> Note: On the ESP32-P4, the USB 2.0 PHY pins are dedicated to USB-OTG functionality and cannot be used as general-purpose GPIOs.
5 changes: 2 additions & 3 deletions examples/peripherals/usb/host/cdc/cdc_acm_host/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ This example shows how to use the CDC-ACM Host Driver to allow an ESP chip to co

### Hardware Required

Two ESP boards that have USB-OTG supported. One will act as USB host and the other as USB device.
Connect USB_D+, USB_D-, GND and +5V signals of USB host to USB device.
Two development boards with USB-OTG support. One will act as USB host and the other as USB device.

#### Pin Assignment

See common pin assignments for USB Device examples from [upper level](../../../README.md#common-pin-assignments).
Follow instruction in [examples/usb/README.md](../../../README.md) for specific hardware setup.

### Build and Flash

Expand Down
12 changes: 5 additions & 7 deletions examples/peripherals/usb/host/cdc/cdc_acm_vcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,26 @@

(See the README.md file in the upper level 'examples' directory for more information about examples.)

This example shows how to extend CDC-ACM driver for Virtual Communication Port (VCP) devices,
such as CP210x, FTDI FT23x or CH34x devices.
This example shows how to extend CDC-ACM driver for Virtual Communication Port (VCP) devices, such as CP210x, FTDI FT23x or CH34x devices.

The drivers are fetched from [ESP Component Registry](https://components.espressif.com/) together with VCP service that automatically loads correct driver for plugged-in device.

## How to use example

1. Connect your USB<->UART converter to ESP32-S2/S3, the device will be automatically enumerated and correct driver will be loaded
1. Connect your USB<->UART converter to ESP board, the device will be automatically enumerated and correct driver will be loaded
2. Change baudrate and other line coding parameters in [cdc_acm_vcp_example_main.cpp](main/cdc_acm_vcp_example_main.cpp) to match your needs
3. Now you can use the usual CDC-ACM API to control the device and send data. Data are received in `handle_rx` callback
4. Try disconnecting and then reconnecting of the USB device to experiment with USB hotplugging

### Hardware Required

* ESP board with USB-OTG supported
* Development board with USB-OTG support
* A USB cable for Power supply and programming
* Silicon Labs CP210x, FTDI FT23x or CP34x USB to UART converter

Connect USB_D+, USB_D-, GND and +5V signals of your ESP chip to matching signals on USB to UART converter.

#### Pin Assignment

See common pin assignments for USB Device examples from [upper level](../../../README.md#common-pin-assignments).
Follow instruction in [examples/usb/README.md](../../../README.md) for specific hardware setup.

### Build and Flash

Expand Down
15 changes: 2 additions & 13 deletions examples/peripherals/usb/host/hid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ This example implements a basic USB Host HID Class Driver, and demonstrates how


### Hardware Required
* Development board with USB capable ESP SoC (ESP32-S2/ESP32-S3)
* Development board with USB-OTG support
* A USB cable for Power supply and programming
* USB OTG Cable

### Common Pin Assignments

If your board doesn't have a USB A connector connected to the dedicated GPIOs,
you may have to DIY a cable and connect **D+** and **D-** to the pins listed below.

```
ESP BOARD USB CONNECTOR (type A)
--
| || VCC
[GPIO19] ------> | || D-
[GPIO20] ------> | || D+
| || GND
--
```
Follow instructions in [examples/usb/README.md](../../README.md) for specific hardware setup.

### Build and Flash

Expand Down
16 changes: 3 additions & 13 deletions examples/peripherals/usb/host/msc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This example demonstrates usage of the MSC (Mass Storage Class) to access storag
3. Create `ESP` subdirectory (if not present already), as well as a `text.txt` file
4. Run read/write benchmarks by transferring 1 MB of data to a `dummy` file

> Note: This example currently supports only FAT-formatted drives. Other file systems, such as exFAT or NTFS, are not compatible with this example. Please ensure that your USB drive is formatted as FAT to avoid compatibility issues.
### USB Reconnections

Expand All @@ -20,24 +21,13 @@ The example is run in a loop so that it can demonstrate USB connection and recon

### Hardware Required

* Development board with USB capable ESP SoC (ESP32-S2/ESP32-S3)
* Development board with USB-OTG support
* A USB cable for Power supply and programming
* A USB flash drive

### Common Pin Assignments

If your board doesn't have a USB A connector connected to the dedicated GPIOs,
you may have to DIY a cable and connect **D+** and **D-** to the pins listed below.

```
ESP BOARD USB CONNECTOR (type A)
--
| || VCC
[GPIO19] ------> | || D-
[GPIO20] ------> | || D+
| || GND
--
```
Follow instructions in [examples/usb/README.md](../../README.md) for specific hardware setup.

Additionally, GPIO0 can be shorted to ground in order to deinitialize USB stack.

Expand Down
7 changes: 2 additions & 5 deletions examples/peripherals/usb/host/usb_host_lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ The example demonstrates the following aspects of the USB Host Library API:

### Hardware Required

An ESP board that has a push button and supports USB-OTG. The example uses the ESP's internal USB PHY, however the internal USB PHY's pins will need to be connected to a USB port (i.e., a USB breakout board) as follows:

- GND and 5V signals of the ESP board to the GND and 5V lines of the USB port
- GPIO 19 to D-
- GPIO 20 to D+
* Development board with USB-OTG support.
* Follow instruction in [examples/usb/README.md](../../README.md) for specific hardware setup.

### Configure the project

Expand Down
4 changes: 3 additions & 1 deletion examples/peripherals/usb/host/uvc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ Optionally, the captured video can be visualized on a PC with help of the `playe

### Hardware Required

* ESP with USB peripheral and external PSRAM
* Development board with USB-OTG support and external PSRAM
* Exposed USB host connector
* USB camera

Running this example on an **ESP module without external PSRAM will fail on initialization**. Please select your PSRAM configuration in menuconfig `Component config->ESP PSRAM`. If you manually disable PSRAM, the required framebuffers might not fit into DRAM (especially on ESP32-S2).

Follow instructions in [examples/usb/README.md](../../README.md) for specific hardware setup.

### Configure the project

Following configuration is needed for streaming video:
Expand Down

0 comments on commit f7da017

Please sign in to comment.