I connected an AdaFruit 3V3 only SD card breakout board to the Teensy4 using individual wires. I used the unpopulated pads on the back of the Teensy4 connecting like wire names between. The only exception being the card detect on the breakout board was left unpopulated.
I am running on Ubuntu Linux. I had Arduino IDE 1.8.12 installed and properly functioning. I can compile programs for Uno, and ESP32 with no trouble.
I then installed the Teensyduino without issue. I am able to compile simple LED blink type programs and have them run on the Teensy4.
I then downloaded the SdFat-beta from githup and installed that from suggestion on a thread in this forum.
Side Note: Arduino on Linux does not like symbolic links. I had tried to just put a symlink called SdFat to SdFat-beta rather than renaming and moving the files. This does not work at all. I also have found this to be a problem trying to give serial ports unique names using udev rules.
Now come my problems.
From the Arduino IDE File...Examples..SD I picked the SdInfo project. This seems to obviously use SdFat as it is called out as a header file. I made NO changes to it and went to run it on a freshly formatted Kingston 8G Micro SD card. Randomly I will get one of two answers from the code:
1) Version 1
2) Second output
Next step was to load the sample project CardInfo. This project does not seem use the SdFat library as only the SD.h and SPI.h are included at the top of the file. Also a forced error in the SdFatConfig.h file does not cause a compiler error. For this example I edited the chipSelect line to set it to BUILTIN_SDCARD (around line 40). This compiles but only produces the following output:
I am thinking this is not likely to work because my interface is SDIO and this appears to be written for plain SPI.
I also tried the DataLogger project and had partial success. New files got created but they had gibberish names. One even had the semblance of real data intermixed again with garbage.
So what am I doing wrong? I have read the main threads on this forum concerning the T4 and SD cards. Looks like I am maybe not the only one confused and befuddled. What is the proper way to be able to log data to an SD card using a T4 and the SDIO 4 lane interface? Might someone even have a working example they might share?
I am running on Ubuntu Linux. I had Arduino IDE 1.8.12 installed and properly functioning. I can compile programs for Uno, and ESP32 with no trouble.
I then installed the Teensyduino without issue. I am able to compile simple LED blink type programs and have them run on the Teensy4.
I then downloaded the SdFat-beta from githup and installed that from suggestion on a thread in this forum.
Side Note: Arduino on Linux does not like symbolic links. I had tried to just put a symlink called SdFat to SdFat-beta rather than renaming and moving the files. This does not work at all. I also have found this to be a problem trying to give serial ports unique names using udev rules.
Now come my problems.
From the Arduino IDE File...Examples..SD I picked the SdInfo project. This seems to obviously use SdFat as it is called out as a header file. I made NO changes to it and went to run it on a freshly formatted Kingston 8G Micro SD card. Randomly I will get one of two answers from the code:
1) Version 1
Code:
SdFat version: 2.0.0
Assuming an SDIO interface.
type any character to start
init time: 147 ms
Card type: SDHC
Manufacturer ID: 0X2
OEM ID: TM
Product: SA08G
Version: 1.3
Serial number: 0X1DC5AC38
Manufacturing date: 1/2014
cardSize: 7742.69 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000
SD Partition Table
part,boot,bgnCHS[3],type,endCHS[3],start,length
1,0X0,0X82,0X3,0X0,0XB,0X53,0XE6,0XAD,8192,15114240
2,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0
3,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0
4,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0X0,0,0
volumeBegin failed. Is the card formatted?
SD errorCode: SD_CARD_ERROR_READ_FIFO = 0X1A
SD errorData = 0X0
type any character to start
2) Second output
Code:
type any character to start
init time: 7 ms
Card type: SDHC
Manufacturer ID: 0X2
OEM ID: TM
Product: SA08G
Version: 1.3
Serial number: 0X1DC5AC38
Manufacturing date: 1/2014
cardSize: 7742.69 MB (MB = 1,000,000 bytes)
flashEraseSize: 128 blocks
eraseSingleBlock: true
OCR: 0XC0FF8000
read MBR failed.
type any character to start
Next step was to load the sample project CardInfo. This project does not seem use the SdFat library as only the SD.h and SPI.h are included at the top of the file. Also a forced error in the SdFatConfig.h file does not cause a compiler error. For this example I edited the chipSelect line to set it to BUILTIN_SDCARD (around line 40). This compiles but only produces the following output:
Code:
Initializing SD card...initialization failed. Things to check:
* is a card inserted?
* is your wiring correct?
* did you change the chipSelect pin to match your shield or module?
I am thinking this is not likely to work because my interface is SDIO and this appears to be written for plain SPI.
I also tried the DataLogger project and had partial success. New files got created but they had gibberish names. One even had the semblance of real data intermixed again with garbage.
So what am I doing wrong? I have read the main threads on this forum concerning the T4 and SD cards. Looks like I am maybe not the only one confused and befuddled. What is the proper way to be able to log data to an SD card using a T4 and the SDIO 4 lane interface? Might someone even have a working example they might share?