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

..--

components/msc/11-Mar-2024-2,2921,589

main/11-Mar-2024-187146

CMakeLists.txtD11-Mar-2024231 75

README.mdD11-Mar-20241.5 KiB6145

README.md

1| Supported Targets | ESP32-S2 | ESP32-S3 |
2| ----------------- | -------- | -------- |
3
4# USB Mass Storage Class example
5
6## Overview
7
8This example demonstrates usage of Mass Storage Class to get access to storage on USB memory stick.
9Example caries out read and write file operations, as USB storage is mounted to Virtual filesystem.
10
11### Hardware Required
12
13* Development board with USB capable ESP SoC (ESP32-S2/ESP32-S3)
14* A USB cable for Power supply and programming
15* A USB memory stick
16
17### Common Pin Assignments
18
19If your board doesn't have a USB A connector connected to the dedicated GPIOs,
20you may have to DIY a cable and connect **D+** and **D-** to the pins listed below.
21
22```
23ESP BOARD    USB CONNECTOR (type A)
24                   --
25                  | || VCC
26[GPIO19]  ------> | || D-
27[GPIO20]  ------> | || D+
28                  | || GND
29                   --
30```
31
32### Build and Flash
33
34Build the project and flash it to the board, then run monitor tool to view serial output:
35
36```
37idf.py -p PORT flash monitor
38```
39
40(To exit the serial monitor, type ``Ctrl-]``.)
41
42See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
43
44## Example Output
45
46```
47...
48I (274) cpu_start: Starting scheduler on PRO CPU.
49I (339) APP: Waiting for USB stick to be connected
50Device info:
51         PID: 0x5678
52         VID: 0xFFFF
53         iProduct: Disk 2.0
54         iManufacturer: USB
55         iSerialNumber: 92072836B2589224378
56I (719) APP: Writing file
57I (749) APP: Reading file
58I (749) APP: Read from file: 'Hello World!'
59I (759) APP: Done
60```
61