Can the ESP32 Mimic a USB Flash Drive?

ESPKEY
Posts: 2
Joined: Sun Jan 06, 2019 9:31 pm

Can the ESP32 Mimic a USB Flash Drive?

Postby ESPKEY » Sun Jan 06, 2019 10:00 pm

Hello...

Would be possible (practical) to make an ESP32 mimic a USB flash drive?

For example, an ESP-WROOM32 module could be set up on a small board to tap and regulate power from a USB male connector, has an FTDI or Silicon Labs C8051F327 USB controller, and maybe a small flash memory IC (probably not needed since the ESP32 has internal flash). Then, when the assembly is plugged into a Mac or PC or smartphone or tablet device with a USB port, it shows up as a generic flash drive to that computer.

What is the advantage? Well, the ESP32 could monitor the contents of the flash drive and respond to changes in files or file content such as JPEG image tags. It could be a way to get some data and short commands out of a smart device's USB port to perform rudimentary control of an external device, since smart devices (tablets and phones) are often locked down from doing any data out from the USB port without expensive cables or MFi certification in the case of iPhones.

Alternately, can an ESP32 "look" into the memory chip of a flash drive while the flash drive is connected to the host computer? That might work also.

Also, I obviously know I can connect the smartphone or tablet to the ESP32 with BLE or WiFi, but a client wants to have hardware USB control of the ESP32 from a smartphone or tablet. That's why I'm researching ways to do this through the USB path.

Is this doable?

Thank you!

--Jim

ESP_Sprite
Posts: 8921
Joined: Thu Nov 26, 2015 4:08 am

Re: Can the ESP32 Mimic a USB Flash Drive?

Postby ESP_Sprite » Tue Jan 08, 2019 10:30 am

Long story short: not without external USB host hardware. The USB port you see on most ESP32 devboards is actually connected to an USB-to-serial converter that only works with that functionality. This is needed because the ESP32 does not have USB functionality on its own. As such, if you want to emulate an USB stick, you'd need to add some external chip that can do USB device, and interface it over e.g. SPI.

Who is online

Users browsing this forum: gfvalvo and 63 guests