Open prototypicalpro opened 4 years ago
I have wasted too much time on Adafruit SAMD SPI bugs.
Try the Adafruit fork of Sdfat.
You might also try a slower SPI frequency. Adafruit tries to allow a max frequency of 24 MHz which is often flaky on SAMD.
I tried using 12MHz or 1MHz speeds, and using the Adafruit SdFat fork, but still had the same issue.
Sorry to hear that. I can close this issue in favor of the one on Adafruit SAMD core?
THANK YOU for ending my hair-pulling. I just hit this too.
I have pretty simple code that has been working for a couple years, that I just recently started working on again, and stopped working, but only on Feather M0 Adalogger. Feather 32u4 Adalogger and Teensy 3.5 & 3.6 all kept working. (teensy is using SDIO though), so of course I assumed I broke it.
At least now I know to stop trying to find what's wrong with my code and I can just document the problem and work-around and move on for now.
This worked for me:
... #elif defined(ADAFRUIT_FEATHER_M0) ... #define SD_SPI_MHZ 12 // https://github.com/adafruit/ArduinoCore-samd/pull/186 ... #if defined(SD_CS_PIN) && defined(SD_SPI_MHZ) if (SD.begin(SD_CS_PIN,SD_SCK_MHZ(SD_SPI_MHZ))) { ...
On an Adafruit Feather M0, using a a version of the Adafruit SAMD core greater than 1.5.7 cause the SD card to fail to initialize. I have also posted this issue in the Adafruit SAMD core issue tracker.
I tested this problem using v1.8.4 of the Arduino SAMD core and v1.1.1 of the SdFat library, uploading the
QuickStart
example sketch to an Adafruit Feather M0 WiFi with an Adalogger Featherwing and 16GB SDcard. No modifications were made to the sketch. Using version v1.5.7 of the Adafruit SAMD Core, I received the following output:However when upgrading to version v1.5.9, the example no longer worked:
A fix for this issue would be appreciated, as many projects I work on use SdFat for low-power SD functionality. Thanks for your help!
Here is my build log for v1.5.7:
Here is my build log for v1.5.9: