-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example of SDIO card with Arduino TinyUSB ? #69
Comments
I'm not sure what you mean. Could you provide a "use case"? |
Thank you for your quick reply, let me explain, SDIO interface connect to RP2040, and then USB on board connect to Windows or Mac. Here's the example for rpi pico, but seems only support SPI interface with low speed. |
I might be able to put something like that together, but for Arduino you should probably start with SdFat. |
That would be awesome! Looking forwarding to this! |
Implemented in the various z80pack machines, there you can export the SD card as disk drive to a PC running Windows, OSX/MacOS, Linux. With this one doesn't need to take out the SD card and put it into some PC with an adapter anymore. For this Raspberry Pi provides stdio_msc_usb, we had problems under Windows with their implementation. For testing have a look at this project, this one is easy to reproduce and includes the fixed stdio_msc_usb: This is for Raspberry Pi Pico and not for Arduino though, I do not know any such implementation for Arduino using SdFat. |
In the SidecarTridge Multi-device, I've implemented a feature called "Mass-storage mode," which allows the device to function as an external USB drive that can be mounted on any PC, Linux, or Mac system. This makes transferring files between the Atari ST and a desktop computer much easier. It sounds similar to what you're looking to implement. Since my device uses SPI from a modern computer, it's quite slow—but still fast enough for the retro systems. If I had more GPIOs available, I’d definitely go with SDIO for faster speeds. The code here: https://github.com/sidecartridge/atarist-sidecart-raspberry-pico/blob/main/romemul/usb_mass.c |
I added |
I'll have to take a look at that. My implementation seems to run slowly. I wonder if the z80pack fixes make it any faster. I've only tested it on Linux so far, so I haven't come across any problems under Windows. |
I ran some quick tests with iozone and compared with an ANKER SD card adapter dongle: Pico 2, SDIO interface at 25 MHz:
and the dongle:
|
It worked fine with Linux and OSX and MacOS. Windows 11 became unresponsible after connecting the USB mass storage device and after a few minutes blue screen. Thomas Eberhardt figured out what the problem is and fixed it. The performace of the USB drives when using SDIO is quite good, comparable to the usual USB stick drives, so I didn't bother to measure it with iozone and the like. With SPI and .baud_rate = 125 * 1000 * 1000 / 4, /* 31.25 MHz */ it works, but often times out. Reading files from the SD is not a problem, but writing often causes filesystem corruption because timed out writes. |
Thank you, very fast coding speed! By the way, is it possible to add a PlatformIO example like this one, I use the PlatformIO and Adafruit_TinyUSB_Arduino, I have this SDK working at hand, Arduino core seems easier for more people to use. |
Sorry, this is not a push, I was wondering if it would be possible to share a PlatformIO arduino example of MSC, in the near future? |
No, not in the near future. |
Hello, is it possible to add such an example, useful for projects to read/write files to board from PC.
I wonder what speed can be, USB maight be the bottle neck.
I searched around, no such example availble yet.
The text was updated successfully, but these errors were encountered: