Example to use ESP32-S3 as MSC with SDIO SD card

wbadry
Posts: 4
Joined: Mon Dec 14, 2020 8:23 pm

Example to use ESP32-S3 as MSC with SDIO SD card

Postby wbadry » Thu Mar 07, 2024 5:31 pm

Hello,
Is there any example of a running ESP32-S3 with an SDIO SD card as a mass storage device?

I tried to look for Adafruit TinyUSB https://github.com/adafruit/Adafruit_TinyUSB_Arduino but it seems that it doesn't support SDIO.

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby liaifat85 » Fri Mar 08, 2024 3:44 pm

You can check this thread regarding connecting esp32-s3 to the sd card in 4-bit sdio protocolhttps://esp32.com/viewtopic.php?t=28377

wbadry
Posts: 4
Joined: Mon Dec 14, 2020 8:23 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby wbadry » Tue Mar 12, 2024 8:38 pm

Thank you for your response. I already know how to read/write to SD card using SDIO interface. Here is a working Example https://github.com/espressif/arduino-es ... C_Test.ino

I am looking at how to make the ESP32S3 connected to an SD card via SDIO to be recognized as a USB mass storage device and easily read the folders and files stored on it. The SPI is there, but I need it to be in an SDIO connection with the SD card.

AyubowanPro
Posts: 5
Joined: Fri Nov 26, 2021 4:25 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby AyubowanPro » Thu May 16, 2024 8:31 am

I'm also interested in doing the same (connect sd card as USB mass storage with ESP32-S3 with Arduino framework). If you succeded in doing it, please tell us :D

lbernstone
Posts: 722
Joined: Mon Jul 22, 2019 3:20 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby lbernstone » Fri May 17, 2024 7:41 pm

Very rough and largely untested. I'll need to set up an sdio config to adapt it to sdio.
https://github.com/lbernstone/SD2USBMSC ... USBMSC.ino

lbernstone
Posts: 722
Joined: Mon Jul 22, 2019 3:20 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby lbernstone » Wed Jun 12, 2024 5:11 pm

New functions added to SD_MMC.h to support this:
https://github.com/espressif/arduino-es ... USBMSC.ino
If someone has a 4-bit sdio rig set up, I'd be interested to know what sort of transfer rates you get versus 1-bit.

Rukbat
Posts: 2
Joined: Wed Jun 12, 2024 11:48 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby Rukbat » Wed Jun 12, 2024 11:54 pm

wbadry:

Are you looking for something like being able to load whichever program you want from an SD card?

Just SD card access, which is what Ibernstone posted the link for, basically gives you ReadFromLBA and WriteToLBA, but no file handling. That takes an operating system.

lbernstone
Posts: 722
Joined: Mon Jul 22, 2019 3:20 pm

Re: Example to use ESP32-S3 as MSC with SDIO SD card

Postby lbernstone » Thu Jun 13, 2024 3:09 am

The previous posted program will act as a USB-MSC client (as OP asked). The USB host (most likely a PC) will provide the OS and filesystem that accesses the disk lun. I was able to transfer a 100MB file in under 2 minutes using 1-bit SDIO. I'd expect at least double that rate with 4-bit, but I'm not sure if USB will be the bottleneck.

Who is online

Users browsing this forum: No registered users and 34 guests