Hi Support,
Thanks to Robin and Paul and the entire development group for an exciting new product in T4.1.
I am having some trouble with getting the sdcard working though.
I have a large monitor type program that ran fine on T3.6 with an earlier (2018) version of SdFat
But have not yet been able to get SdFat running on the T4.1.
Here are details:
TD1.52 SdFat-beta for 4.0-4.1 from greiman
Running clock 600mhz with other settings a default.
sdcard formatted FAT32 16GB with a few files on it.
The cardinfo example based on SD lib runs fine and even prints the list of files.
But the OpenNext example fails on 4.1 (but runs fine on a Teensy 3.6)
The only info I get is that it failed the begin() - method returns 0.
Here is the smallest program I could make to reproduce the failure.
All of the includes are in the program to in case they are part of the problem (extracted from the original much larger program).
I've tried all 3 SD_FAT_TYPEs and they all fail.
If you have any suggestions so I can provide more info or things to read up on (I've tried the Sdfat html class pages but am not sure where to begin), I would appreciate it very much.
#include <stdio.h>
#include <stdlib.h>
#include "TeensyThreads.h"
#include <EEPROM.h>
//#include <i2c_t3.h> New i2c lib: Used instead of Wire.h see Documents for doc
#include <Wire.h>
#include <ILI9341_t3.h>
#include <Streaming.h>
#include <Metro.h>
#include <SPI.h> // WARNING : TEENSY DEFAULT LED (PIN 13) IS OVER-RIDDEN BY SCK FOR SPI
#include <TimeLib.h>
#include <XPT2046_Touchscreen.h>
#include "DHT.h"
#include <FreqMeasureMulti.h>
#include "SdFat.h"
#define SD_FAT_TYPE 1
#if SD_FAT_TYPE == 1
SdFat SD;
// File file;
File filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
File root;
#elif SD_FAT_TYPE == 2
SdExFat SD;
ExFile filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
ExFile root;
#elif SD_FAT_TYPE == 3
SdFs SD;
FsFile filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
FsFile root;
#endif // SD_FAT_TYPE
// ILI9341_t3 tft
const uint8_t CS_PIN = 8, TFT_CS = 10, TFT_DC = 9, TIRQ_PIN = 2;
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC); // 'n' version causing errors
XPT2046_Touchscreen ts(CS_PIN); // TFT GRAPHICS OBJECTS TOUCHSCREEN
TS_Point p, pmap;
// CALLBACK ROUTINES
time_t newtime, tempSystime;
void dateTime(uint16_t* date, uint16_t* time) { // Following used by -> SdFile::dateTimeCallback(dateTime);
*date = FAT_DATE(year(), month(), day()); // set date time callback function
*time = FAT_TIME(hour(), minute(), second());
}
time_t getTeensy3Time() {
return Teensy3Clock.get();
}
void setup() {
tft.begin();
ts.begin(); // touchscreen begin
tft.fillScreen(ILI9341_BLACK); tft.setRotation(1);
if (!SD.begin()) {
Serial.println("SD initialization failed!");
tft.setCursor(5, 205);
tft.setTextSize(2);
tft.print("SD failed to initialize");
delay(3000);
} else {
SdFile::dateTimeCallback(dateTime); // set date time callback function
Serial.println("SD Init success ..file timestamp callback installed "); }
}
void loop() {
}
Thanks to Robin and Paul and the entire development group for an exciting new product in T4.1.
I am having some trouble with getting the sdcard working though.
I have a large monitor type program that ran fine on T3.6 with an earlier (2018) version of SdFat
But have not yet been able to get SdFat running on the T4.1.
Here are details:
TD1.52 SdFat-beta for 4.0-4.1 from greiman
Running clock 600mhz with other settings a default.
sdcard formatted FAT32 16GB with a few files on it.
The cardinfo example based on SD lib runs fine and even prints the list of files.
But the OpenNext example fails on 4.1 (but runs fine on a Teensy 3.6)
The only info I get is that it failed the begin() - method returns 0.
Here is the smallest program I could make to reproduce the failure.
All of the includes are in the program to in case they are part of the problem (extracted from the original much larger program).
I've tried all 3 SD_FAT_TYPEs and they all fail.
If you have any suggestions so I can provide more info or things to read up on (I've tried the Sdfat html class pages but am not sure where to begin), I would appreciate it very much.
#include <stdio.h>
#include <stdlib.h>
#include "TeensyThreads.h"
#include <EEPROM.h>
//#include <i2c_t3.h> New i2c lib: Used instead of Wire.h see Documents for doc
#include <Wire.h>
#include <ILI9341_t3.h>
#include <Streaming.h>
#include <Metro.h>
#include <SPI.h> // WARNING : TEENSY DEFAULT LED (PIN 13) IS OVER-RIDDEN BY SCK FOR SPI
#include <TimeLib.h>
#include <XPT2046_Touchscreen.h>
#include "DHT.h"
#include <FreqMeasureMulti.h>
#include "SdFat.h"
#define SD_FAT_TYPE 1
#if SD_FAT_TYPE == 1
SdFat SD;
// File file;
File filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
File root;
#elif SD_FAT_TYPE == 2
SdExFat SD;
ExFile filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
ExFile root;
#elif SD_FAT_TYPE == 3
SdFs SD;
FsFile filex, fhandle1, fhandle2, fhandle3, anaFile, hexFile, afile, bfile ;
FsFile root;
#endif // SD_FAT_TYPE
// ILI9341_t3 tft
const uint8_t CS_PIN = 8, TFT_CS = 10, TFT_DC = 9, TIRQ_PIN = 2;
ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC); // 'n' version causing errors
XPT2046_Touchscreen ts(CS_PIN); // TFT GRAPHICS OBJECTS TOUCHSCREEN
TS_Point p, pmap;
// CALLBACK ROUTINES
time_t newtime, tempSystime;
void dateTime(uint16_t* date, uint16_t* time) { // Following used by -> SdFile::dateTimeCallback(dateTime);
*date = FAT_DATE(year(), month(), day()); // set date time callback function
*time = FAT_TIME(hour(), minute(), second());
}
time_t getTeensy3Time() {
return Teensy3Clock.get();
}
void setup() {
tft.begin();
ts.begin(); // touchscreen begin
tft.fillScreen(ILI9341_BLACK); tft.setRotation(1);
if (!SD.begin()) {
Serial.println("SD initialization failed!");
tft.setCursor(5, 205);
tft.setTextSize(2);
tft.print("SD failed to initialize");
delay(3000);
} else {
SdFile::dateTimeCallback(dateTime); // set date time callback function
Serial.println("SD Init success ..file timestamp callback installed "); }
}
void loop() {
}