SD card issues

I have been trying to use the SD with oopsy, but I can’t make it work

I have my daisy seed connected with the SD card, it has drumLoop.wav on it

On C++ I have tried this settings with WavPlayer.cpp:

With 400khz it works with 1 bit, but does not with 4 bits
With 12.5Mhz it works with 1 bit, but does not with 4 bits (maybe 4 bits is not compatible with those frequencies)
On 25Mhz it works on 4 bits
On 50Mhz it works on 1 bit, but does not with 4 bits (maybe some inductance on one of the 3 bits left)

In Max/MSP, on source/genlib_daisy.h there is this code:

void sdcard_init() {
			daisy::SdmmcHandler::Config sdconfig;
			sdconfig.Defaults(); // 4-bit, 50MHz
			// sdconfig.clock_powersave = false;
			sdconfig.speed           = daisy::SdmmcHandler::Speed::STANDARD; //this line was commented, I don't know if it works
			sdconfig.width           = daisy::SdmmcHandler::BusWidth::BITS_4;
			f_mount(&SDFatFS, SDPath, 1);

So, changing speed and width on those lines I have tried:
25Mhz (STANDARD) 4 bits and 1 bit, not working
On default speed (I think it’s FAST=50Mhz) 4 bits and 1 bit, not working

I used the ‘sdcard-minimal.maxpat’ example

If you’re using a breadboard, you might be running into an issue with the default GPIO drive strength. It came up in this thread.

It’s come up a few times now, so I just submitted a PR which should help make the behavior more predictable.

1 Like

I am using copper wires with terminals, nothing is on the breadboard. And it works fine on 25Mhz on C++, so I don’t think it has too many noise/ringing

The problem is it does NOT work on MAX/MSP (oopsy)

In those links you are talking about libDaisy, I don’t know how to set GPIO_speed on MAX/MSP

If you want to test if it solves your problem in the context of Oopsy, you could modify src/per/sdmmc.cpp as I described in the linked forum thread. You can find the file in the source/libdaisy folder of your oopsy install, and rebuild it using the script included in Oopsy.