ESP32 SD Card Speedup With a Couple of Lines of Code

preview_player
Показать описание

It starts off pretty slow, but there's quite a few optimisations that we can make to get it quite a bit faster!

I'm using the USBMSC class to mount the SD Card connected to the ESP32 to my PC. It does work - but it's a bit slow - but we can make it faster!

---

And if you're shopping on AliExpress or Amazon then if you click on these links I will get a little bit of affiliate money:

Рекомендации по теме
Комментарии
Автор



And if you're shopping on AliExpress or Amazon then if you click on these links I will get a little bit of affiliate money:




atomic
Автор

Alot of this is over my head but I think I’m gaining an appreciation for possibilities and limitations of these MCs

neilomalley
Автор

Using USBMSC on ESP32-S3 I've had good results writing and reading to/from Winbond flash chips instead of SD notwithstanding the USB1.1 limitations. I like the idea of a dedicated chip instead of a removable medium. I've also tried FRAM which is very fast - almost as fast as SRAM - but capacities at the time of writing are small. IDF and Adafruit libs are available to support serial Flash / Fram. Wear leveling for Flash is even supported.

nikthefix
Автор

I'm loving the project! The improvements made with a few changes on the code are tremendous, and that could also work but by adding a USB controller and a SD card slot the writting to the PCB the speeds will increase by significant ammounts. I'm really keen to see how this project goes

Dinkleberg
Автор

Whelp, that GL823K datasheet ain't great... but the status LED and GPIO might be ways to give you status and a way to do the switching after it's done. If you're doing a PCB to play with these things, I'd add in a couple of DNP resistor/jumpers to experiment with these, in addition to just keeping an eye on vbus. Curious to see how it works out with this IC.

PsychogenicTechnologies
Автор

I'm still following with interest. The serial I/O bottlenecks are news to me, so this episode is really paying off. I follow with rapt attention. Continued Success!

devcybiko
Автор

If ESP32 monitors the Presence of USB (5V + signal lines) then ESP32 can switch properly switch between computer reading/writing SD Card and ESP32 reading/writing SD card. It means finishing the ESP32 SC Card read/write cycle and enabling USB access to the SD Card. If ESP32 is not switched ON (by battery) then Logic is powered by USB 5V and access to SC Card via USB is enabled. If ESP32 is charged via charger (no USB signals are present) then Charging and reading/writing SC Card via ESP32 is enabled.

dusanpecek
Автор

Maybe instead of a USB mux, just use a hub ic and automatically mux the SD card to the GL823 card reader when you sense that USB is connected.

ArtiZirk
Автор

How about using RTOS to run two threads, one reading data from the USB and buffering, and another to write from the buffer to the SD-card?

thomasbjrnsonlarsen
Автор

I'm looking for code to read/write individual sectors on an SD card.
Can somebody point me to a download/code. They seem to be mentioned here but no reference

monahanz
Автор

😮 This was the hard one;
That’s me “😊😊😊” when I hear “we built a new pcb”

Thanks buddy

raymondmichael
Автор

Thank you for the very informative video. I have a problem with a software I'm developing: I read an Audio file from SD and play it via i2s. The reading is 3072 bytes at a time. It happens every now and then that the reading takes 500/600 ms instead of the 15ms it normally does. This behavior is not periodic but random. This ruins the audio streaming. Have you ever encountered this problem? I use esp32s3

davidealessandrini
Автор

Thanks for the helpful tips! Really appreciate the clear instructions, you made it so simple!

Sogager
Автор

how can i upload a code in esp32 dev board using Arduino IDE.... NEED HELP

OLDNEWTECH
Автор

werry interesting, was also looking for solution how to switch sd card from any device to usb, and of course best to usb3 :) thanks for sharing !!

donatasismanus
Автор

Using the GL823 is an excellent solution. I have used a similar setup in the past with GL835. GL835 has a power-saving mode so you don't need the second switch (PI3A27518), just put the ESP32 pins into Hi-Z mode when connecting USB. GL835 can go into sleep/standby mode when USB is not connected. I'm not sure this will work with GL823 though.

jespernoer
Автор

This for storage + the Linux "hack" on the ESP32-S3..

mortenmoulder
Автор

😮 This was the hard one;
That’s me “😊😊😊” when I hear “we built a new pcb”

Thanks buddy

raymondmichael