docs(usb_host): Update usb_host example READMEs for P4

Closes https://github.com/espressif/esp-idf/issues/14578
Closes https://github.com/espressif/esp-idf/issues/12142
pull/12126/merge
Tomas Rezucha 2024-10-29 12:01:11 +01:00
rodzic 358e140705
commit f7da0175b0
7 zmienionych plików z 22 dodań i 44 usunięć

Wyświetl plik

@ -1,10 +1,10 @@
# USB-OTG Examples # 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 ## 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. 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.
``` ```
@ -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 | | | USB_DP | USB_DM |
| ----------- | ------ | ------ | | ----------- | ------ | ------ |
| ESP32-S2/S3 | GPIO20 | GPIO19 | | 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.

Wyświetl plik

@ -11,12 +11,11 @@ This example shows how to use the CDC-ACM Host Driver to allow an ESP chip to co
### Hardware Required ### Hardware Required
Two ESP boards that have USB-OTG supported. One will act as USB host and the other as USB device. Two development boards with USB-OTG support. 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.
#### Pin Assignment #### 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 ### Build and Flash

Wyświetl plik

@ -5,28 +5,26 @@
(See the README.md file in the upper level 'examples' directory for more information about examples.) (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, This example shows how to extend CDC-ACM driver for Virtual Communication Port (VCP) devices, such as CP210x, FTDI FT23x or CH34x 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. 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 ## 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 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 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 4. Try disconnecting and then reconnecting of the USB device to experiment with USB hotplugging
### Hardware Required ### 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 * 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 #### 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 ### Build and Flash

Wyświetl plik

@ -6,24 +6,13 @@ This example implements a basic USB Host HID Class Driver, and demonstrates how
### Hardware Required ### 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 cable for Power supply and programming
* USB OTG Cable * USB OTG Cable
### Common Pin Assignments ### Common Pin Assignments
If your board doesn't have a USB A connector connected to the dedicated GPIOs, Follow instructions in [examples/usb/README.md](../../README.md) for specific hardware setup.
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
--
```
### Build and Flash ### Build and Flash

Wyświetl plik

@ -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 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 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 ### USB Reconnections
@ -20,24 +21,13 @@ The example is run in a loop so that it can demonstrate USB connection and recon
### Hardware Required ### 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 cable for Power supply and programming
* A USB flash drive * A USB flash drive
### Common Pin Assignments ### Common Pin Assignments
If your board doesn't have a USB A connector connected to the dedicated GPIOs, Follow instructions in [examples/usb/README.md](../../README.md) for specific hardware setup.
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
--
```
Additionally, GPIO0 can be shorted to ground in order to deinitialize USB stack. Additionally, GPIO0 can be shorted to ground in order to deinitialize USB stack.

Wyświetl plik

@ -32,11 +32,8 @@ The example demonstrates the following aspects of the USB Host Library API:
### Hardware Required ### 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: * Development board with USB-OTG support.
* Follow instruction in [examples/usb/README.md](../../README.md) for specific hardware setup.
- 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+
### Configure the project ### Configure the project

Wyświetl plik

@ -22,12 +22,14 @@ Optionally, the captured video can be visualized on a PC with help of the `playe
### Hardware Required ### Hardware Required
* ESP with USB peripheral and external PSRAM * Development board with USB-OTG support and external PSRAM
* Exposed USB host connector * Exposed USB host connector
* USB camera * 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). 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 ### Configure the project
Following configuration is needed for streaming video: Following configuration is needed for streaming video: