Hi ! I have been working on a project for the past month on Arduino IDE. I have to now implement a feature that lets me use my MCU (ESP32 -S3 - DFR1145 FireBeetle 2 ) as a USB host to connect a mass storage device (most likely a USB Flash drive or a SD card reader ).
I wish to transfer all the log files I have on an SD card connected to my MCU, to a Flash Drive. My problem is, I cannot seem to find anything useful in the arduino core to help me use my esp32-s3 as a USB-CDC Host device.
The closest I have come is through this library : https://github.com/chegewara/EspTinyUSB . It still fails to compile and says hal/usb_hal.h is missing, which I figured was because of me using arduino-esp32 v3.x., instead of v2.x. I downgraded to 2.0.17, yet I haven't achieved any success.
Digging around, I have been led to believe that the Arduino Core for ESP32 has limited native USB Host support, so ESP-IDF is recommended for direct access to USB Host libraries. The thing is, I am fairly new to embedded programming, totally out of my depth when it comes to ESP-IDF. I am trying but have not gotten any success at all.
Can someone please point me to the right direction ? Any example of reading/writing to a mass storage device as a USB host. Any teeny-tiny implementation that I can leverage to make further progress. Thanks a lot, in advance.
Reading/Writing to a USB Flash Drive with DFR1145 firebeetle 2 ESP32-S3 as USB host.
Re: Reading/Writing to a USB Flash Drive with DFR1145 firebeetle 2 ESP32-S3 as USB host.
So, my board is a DFR-1145 FireBeetle2 ESP32-S3 (N4) - DFR-1145 wiki - https://wiki.dfrobot.com/_SKU_DFR1145_F ... ment_board
It has one USB-C port that I have been using to flash and monitor serial on (Hardware CDC & JTAG ?). The second I believe are the USB OTG pinouts ? IO19/D- & IO20/D+
I have been trying to make use of chegewara's ESPTinyUSB library to implement the USB Host funtionality. I am trying to run
EspTinyUSB/examples/host
/msc/ example.
https://github.com/chegewara/EspTinyUSB
I have connected a female USB-A breakout board to the MCU

Initially, the sketch didn't compile as the library is not compatible with arduino-esp32 v3.x because of header changes in ESP-IDF 5.X. Relevant Issue Thread - https://github.com/chegewara/EspTinyUSB/issues/157
So, I rolled-back to arduino-esp-32 v2.0.10. Now, the code does compile, but gives me a warning -
warning: alignment 1 of symbol `ff_raw_handles' in ..\libraries\ESP32TinyUSB\host\msc\vfs\diskio_rawmsc.cpp.o is smaller than 4 in ..\Arduino15\packages\esp32\hardware\esp32\2.0.10/tools/sdk/esp32s3/lib\libfatfs.a(diskio_rawflash.c.obj)
Also, nothing happens. Here's a screenshot of my settings

Am I even partially on the right trajectory ? Any pointers ? I am completely lost.
Here's the host/msc sketch that I've been trying to run.
https://github.com/chegewara/EspTinyUSB ... sc/msc.ino
It has one USB-C port that I have been using to flash and monitor serial on (Hardware CDC & JTAG ?). The second I believe are the USB OTG pinouts ? IO19/D- & IO20/D+
I have been trying to make use of chegewara's ESPTinyUSB library to implement the USB Host funtionality. I am trying to run
EspTinyUSB/examples/host
/msc/ example.
https://github.com/chegewara/EspTinyUSB
I have connected a female USB-A breakout board to the MCU

Initially, the sketch didn't compile as the library is not compatible with arduino-esp32 v3.x because of header changes in ESP-IDF 5.X. Relevant Issue Thread - https://github.com/chegewara/EspTinyUSB/issues/157
So, I rolled-back to arduino-esp-32 v2.0.10. Now, the code does compile, but gives me a warning -
warning: alignment 1 of symbol `ff_raw_handles' in ..\libraries\ESP32TinyUSB\host\msc\vfs\diskio_rawmsc.cpp.o is smaller than 4 in ..\Arduino15\packages\esp32\hardware\esp32\2.0.10/tools/sdk/esp32s3/lib\libfatfs.a(diskio_rawflash.c.obj)
Also, nothing happens. Here's a screenshot of my settings

Am I even partially on the right trajectory ? Any pointers ? I am completely lost.
Here's the host/msc sketch that I've been trying to run.
https://github.com/chegewara/EspTinyUSB ... sc/msc.ino
Who is online
Users browsing this forum: No registered users and 1 guest