siara-cc / sqlite_micro_logger_arduino

Fast and Lean Sqlite database logger for Arduino UNO and above
Apache License 2.0
169 stars 29 forks source link

ARM SAMD M0 & SdFat require reduced clock #4

Open constant-flow opened 3 years ago

constant-flow commented 3 years ago

Error

When using the sdfat sample the code reports failure until you decrease the clock speed of the SD card. This is an issue discussed here as well.

Testing

My board: Arduino MKR Wifi 1010 Example: Uno_and_above_SdFat

Fix

changing l.435 in Uno_and_above_SdFat.ino from if (!SD.begin(SD_CS_PIN)) { to if (!SD.begin(SD_CS_PIN, SD_SCK_MHZ(12))) { fixed it for me.

Further details

The SdFat-QuickStart even uses only 4 MHz.

siara-cc commented 1 year ago

Hi sorry I saw this only now. It seems I haven't been getting notifications as I was not a Watcher for this repo. Please see this comment: https://github.com/siara-cc/esp_arduino_sqlite3_lib/issues/23#issuecomment-1374843886 It could be the reason for this issue. Since there could be a lot of IO issues like this, I kept IO functions outside this library so the users can handle it if it does not work for them.