Redboard Turbo using SPI to run microSD card (#00544 or #13743)

I cannot get SPI working between my Redboard Turbo and the TransFlash microSD device (part 00544). I see a similar post from 2019 that also indicated problems with the Turbo and SPI.

viewtopic.php?f=145&t=49946&p=204389&hi … bo#p204389

I need to use the SdFat library rather than the default SD library (for long file names and the ability to timestamp files). I have code that works fine with a #13743 microSD card and an Arduino Mega. I think the 13743 is for a 5V system, and the Transflash is for a 3.3V? I don’t know this - if the 13743 is for 5V systems, why does it need level shifting? Will the 13743 work with the Turbo?

Anyway, I cannot get the sd.begin to work. I have tried two forms of it,

sd.begin(chipSelect)
sd.begin(chipSelect, SD_SCK_MHZ(50))

Either one always fails. I have tried a host of combinations with

a) different chipSelect pins (I have tried 4,6,8,10,16,18,28 based on various posts). The SS #define is 16, but I don’t know where 16 is. I don’t see it on the datasheet diagram. I assume I need to run a wire from that pin to the disk CS pin.

b) wiring the SPI pins to either the 2x3 pin connector on the board (are these the legacy pins?) or pins 11,12,13. The #defines are for MISO = 22, MOSI = 23, SCLK= 24. The Turbo datasheet shows the SPI pins on the 2x3 connector, but these pin numbers (22…24) are not shown.

Maybe the system does not define SPI by default? I suspect I need to do the magic Sercom process to create an SPI port? I have read the Sercom Tutorial but it was pretty unclear. Is there an example somewhere of creating the SPI port? Does creating a Sercom port also imply I need to modify the SdFat library?

Does this board support SPI to these little disk drives? I also looked at the Qwiic Openlog, but it does not support SdFat.

I think you would need to edit the API config after setting up the SERCOM port…alternatively, you could use one of these https://www.sparkfun.com/products/16832 and the exFAT library, if that suits your use-case?

“need to edit the API config after setting up the SERCOM port”. Sadly, I don’t know what this means. After looking at the internal code again and the tutorial on adding sercom channels, it really looks like the SPI has already been set up. I think I would have to debug the SPI and SDFat libraries to find the problem. Unfortunately I don’t have time to do that - comstruction of the systems begins in two weeks:(

The Artemis OpenLogger only supports logging from a selected list of sensors, although I think one can modify the code to add sensors? However, I need to log more than I2C sensor data.

I had tried using the Qwiic OpenLogger, but a) it had problems with dropping data, and b) I can’t get long file names and file timestamps (it does not support SdFat). I plan to return to that option and see if I can fix the communications issue. I would do “long file names” by placing files in a series of nested folders, where each folder name is part of the desired file name. Kludgy.