Hello! Is it possible to use the SD library with Adafruit Feather nRF52832 Bluefruit? I tried to use it but it never connects with the SD card reader. My hypothesis is that it's not working because the MISO, MOSI & CLK pins on this board are define as 12, 13, 14, but the library says to use pins 11, 12 ,13. Is there anyway around this? Any suggestions would be greatly appreciated thanks!
Change the pin numbers in the lib is a possibility.
the SD library uses the SPI library and the SPI library is bundled with core so it knows the right SPI pin numbers. did you run the CardInfo diagnostic example?
So, I ran the CardInfo sketch, and a few other SD example sketches and kept getting this error message:
However, every now and then I don't get that error message while running the SD sketches and am able to connect to the SD card. So I guess, the library does work with this chip, but very inconsistently. Any ideas on why this may be happening?
I was thinking about this as well, but luckily it doesn't seem necessary. The library does seem to work with this board but very inconsistently. I posted a screenshot of the error I keep getting, if you have any thoughts on as to why this may be happening, I would love to hear them.
Please don't use screen shots. Copy the text and paste it like code.
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp: In member function 'uint8_t SdFile::open(SdFile*, const char*, uint8_t)':
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:532:15: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
532 | dateTime_(&p->creationDate, &p->creationTime);
| ^~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:532:15: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:532:33: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
532 | dateTime_(&p->creationDate, &p->creationTime);
| ^~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:532:33: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp: In member function 'uint8_t SdFile::sync(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:1155:17: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
1155 | dateTime_(&d->lastWriteDate, &d->lastWriteTime);
| ^~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:1155:17: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:1155:36: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
1155 | dateTime_(&d->lastWriteDate, &d->lastWriteTime);
| ^~~~~~~~~~~~~~~~~
C:\Program Files (x86)\Arduino\libraries\SD\src\utility\SdFile.cpp:1155:36: warning: taking address of packed member of 'directoryEntry' may result in an unaligned pointer value [-Waddress-of-packed-member]
Will keep that in mind next time, thanks.
usually if an SPI device works inconsistently, the problem is floating CS pin of that or other SPI device on the same bus
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.