SD not initializing in XIAO RoundDisplay with ESP32C3

I’m using 32GB SD card.

This is my code trying to store these data in the SD card. But I’m not able to initiialize the SD card :frowning:

#include <Arduino.h>
#include <TFT_eSPI.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
#include <SD.h>


#define SEALEVELPRESSURE_HPA (1013.25)

#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
#include "esp_wifi.h"
#include "WiFi.h"
const char *ntpServer = "time.cloudflare.com";
const char *ssid = "Adith";
const char *password = "aadithsp";
#endif

#include "I2C_BM8563.h"
#include "NotoSansBold15.h"
I2C_BM8563 rtc(I2C_BM8563_DEFAULT_ADDRESS, Wire);
Adafruit_BME680 bme; // Create a BME680 sensor object for I2C


I2C_BM8563_TimeTypeDef timeStruct;
I2C_BM8563_DateTypeDef dateStruct;

//TFT_eSPI tft = TFT_eSPI();  // Invoke library, pins defined in User_Setup.h
TFT_eSPI tft = TFT_eSPI();
File myFile;
TFT_eSprite face = TFT_eSprite(&tft);

#define CLOCK_X_POS 10
#define CLOCK_Y_POS 10

#define CLOCK_FG TFT_SKYBLUE
#define CLOCK_BG TFT_NAVY
#define SECCOND_FG TFT_RED
#define LABEL_FG TFT_GOLD

#define CLOCK_R 230.0f / 2.0f  // Clock face radius (float type)
#define H_HAND_LENGTH CLOCK_R / 2.0f
#define M_HAND_LENGTH CLOCK_R / 1.4f
#define S_HAND_LENGTH CLOCK_R / 1.3f

#define FACE_W CLOCK_R * 2 + 1
#define FACE_H CLOCK_R * 2 + 1

// Calculate 1 second increment angles. Hours and minute hand angles
// change every second so we see smooth sub-pixel movement
#define SECOND_ANGLE 360.0 / 60.0
#define MINUTE_ANGLE SECOND_ANGLE / 60.0
#define HOUR_ANGLE MINUTE_ANGLE / 12.0

// Sprite width and height
#define FACE_W CLOCK_R * 2 + 1
#define FACE_H CLOCK_R * 2 + 1

// Time h:m:s
uint8_t h = 0, m = 0, s = 0;

float time_secs = h * 3600 + m * 60 + s;

// Time for next tick
uint32_t targetTime = 0;

// =========================================================================
// Setup
// =========================================================================
void setup() {

  Serial.begin(115200); 

  // Initialise the screen
  tft.init();

  // Ideally set orientation for good viewing angle range because
  // the anti-aliasing effectiveness varies with screen viewing angle
  // Usually this is when screen ribbon connector is at the bottom
  tft.setRotation(0);
  tft.fillScreen(TFT_BLACK);

  // Create the clock face sprite
  //face.setColorDepth(8); // 8 bit will work, but reduces effectiveness of anti-aliasing
  face.createSprite(FACE_W, FACE_H);

  // Only 1 font used in the sprite, so can remain loaded
  face.loadFont(NotoSansBold15);

  // Draw the whole clock - NTP time not available yet
  renderFace(time_secs);

#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
  WiFi.begin(ssid, password);
  for (int a = 0; a < 10; a++) {
    if (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print("\nWaiting for WiFi Connection...");
   }
    delay(500);
  }
  delay(1000);
  if (WiFi.status() == WL_CONNECTED)
  {
    Serial.print("\nWiFi Successfully Connected!");
  }
  else
  {
    Serial.print("\nWiFi Connection Failed");
  }
  delay(1000);
  configTime(8 * 3600, 0, ntpServer);
  struct tm timeInfo;
  if (getLocalTime(&timeInfo)) {
    timeStruct.hours = timeInfo.tm_hour;
    timeStruct.minutes = timeInfo.tm_min;
    timeStruct.seconds = timeInfo.tm_sec;
    rtc.setTime(&timeStruct);
    // dateStruct.weekDay = timeInfo.tm_wday;
    // dateStruct.month   = timeInfo.tm_mon + 1;
    // dateStruct.date    = timeInfo.tm_mday;
    // dateStruct.year    = timeInfo.tm_year + 1900;
    // rtc.setDate(&dateStruct);
  }
#endif

  Wire.begin();
  rtc.begin();
  syncTime();

  //
  while (!Serial);
  Serial.println(F("\nBME688 test"));
  delay(1000);
  if (!bme.begin()) 
  {
    Serial.println("\nCould not find a valid BME688 sensor, check wiring!");
    while (1); // Stay in a loop if the sensor is not found
  } 
  // Configure sensor settings
  bme.setTemperatureOversampling(BME680_OS_8X);
  bme.setHumidityOversampling(BME680_OS_2X);
  bme.setPressureOversampling(BME680_OS_4X);
  bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
  bme.setGasHeater(320, 150); // 320°C for 150 ms
  ///////////////////////////////////////////////////////////////////
    // Open serial communications and wait for port to open:
 
  while(!Serial);

  Serial.print("Initializing SD card...");

  pinMode(D2, OUTPUT);
  if (!SD.begin(D2)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  myFile = SD.open("/test.txt", FILE_WRITE);

  // if the file opened okay, write to it:
  if (myFile) {
    Serial.print("Writing to test.txt...");
    myFile.println("testing 1, 2, 3.");
    // close the file:
    myFile.close();
    Serial.println("done.");
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }

  // re-open the file for reading:
  myFile = SD.open("/test.txt");
  if (myFile) {
    Serial.println("test.txt:");

    // read from the file until there's nothing else in it:
    while (myFile.available()) {
      Serial.write(myFile.read());
    }
    // close the file:
    myFile.close();
  } else {
    // if the file didn't open, print an error:
    Serial.println("error opening test.txt");
  }
}

// =========================================================================
// Loop
// =========================================================================
void loop() {
  sensor();
  // Update time periodically
  if (targetTime < millis()) {

    // Update next tick time in 100 milliseconds for smooth movement
    targetTime = millis() + 100;

    // Increment time by 100 milliseconds
    time_secs += 0.100;

    // Midnight roll-over
    if (time_secs >= (60 * 60 * 24)) time_secs = 0;

    // All graphics are drawn in sprite to stop flicker
    renderFace(time_secs);

    // syncTime();
  }
}
void sensor()
{
  //////////////////////////////////////////
  I2C_BM8563_DateTypeDef dateStruct;
  I2C_BM8563_TimeTypeDef timeStruct;
  // Get RTC
  rtc.getDate(&dateStruct);
  rtc.getTime(&timeStruct);
  // Print RTC
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
  Serial.print("\nYear = ");
  Serial.print(dateStruct.year);
  Serial.print("\nMonth = ");
  Serial.print(dateStruct.month);
  Serial.print("\nDate = ");
  Serial.print(dateStruct.date);
  Serial.print("\nHours = ");
  Serial.print(timeStruct.hours);
  Serial.print("\nMinutes = ");
  Serial.print(timeStruct.minutes);
  Serial.print("\nSeconds = ");
  Serial.print(timeStruct.seconds);
  Serial.println();
#endif
  delay(1);
//////////////////////////////////////////
  // Check if the BME680 sensor reading was successful
  if (!bme.performReading()) 
  {
    Serial.println("Failed to perform reading :(");
    return;
  } 
  // Display temperature in degrees Celsius
  Serial.print("Temperature = ");
  Serial.print(bme.temperature);
  Serial.println(" °C"); 
  // Display pressure in hPa (hectopascals)
  Serial.print("Pressure = ");
  Serial.print(bme.pressure / 100.0);
  Serial.println(" hPa"); 
  // Display humidity in percentage
  Serial.print("Humidity = ");
  Serial.print(bme.humidity);
  Serial.println(" %"); 
  // Calculate Dew Point
  float dewPoint = bme.temperature - ((100 - bme.humidity) / 5);
  Serial.print("Dew Point = ");
  Serial.print(dewPoint);
  Serial.println(" °C"); 
  // Display gas resistance in KOhms
  Serial.print("Gas = ");
  Serial.print(bme.gas_resistance / 1000.0);
  Serial.println(" KOhms"); 
  // Calculate and display approximate altitude
  Serial.print("Approx. Altitude = ");
  Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA));
  Serial.println(" m"); 
  // Print a blank line for better readability
  Serial.println(); 
  Serial.println(); 
  // Delay for 2 seconds before the next reading
  delay(1000);
}

// =========================================================================
// Draw the clock face in the sprite
// =========================================================================
static void renderFace(float t) {
  float h_angle = t * HOUR_ANGLE;
  float m_angle = t * MINUTE_ANGLE;
  float s_angle = t * SECOND_ANGLE;

  // The face is completely redrawn - this can be done quickly
  face.fillSprite(TFT_BLACK);

  // Draw the face circle
  face.fillSmoothCircle(CLOCK_R, CLOCK_R, CLOCK_R, CLOCK_BG);

  // Set text datum to middle centre and the colour
  face.setTextDatum(MC_DATUM);

  // The background colour will be read during the character rendering
  face.setTextColor(CLOCK_FG, CLOCK_BG);

  // Text offset adjustment
  constexpr uint32_t dialOffset = CLOCK_R - 10;

  float xp = 0.0, yp = 0.0;  // Use float pixel position for smooth AA motion

  // Draw digits around clock perimeter
  for (uint32_t h = 1; h <= 12; h++) {
    getCoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12);
    face.drawNumber(h, xp, 2 + yp);
  }

  // Add text (could be digital time...)
  face.setTextColor(LABEL_FG, CLOCK_BG);
  face.drawString("DePaul University", CLOCK_R, CLOCK_R * 0.75);

  // Draw minute hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);

  // Draw hour hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);

  // Draw the central pivot circle
  face.fillSmoothCircle(CLOCK_R, CLOCK_R, 4, CLOCK_FG);

  // Draw cecond hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle);
  face.drawWedgeLine(CLOCK_R, CLOCK_R, xp, yp, 2.5, 1.0, SECCOND_FG);
  face.pushSprite(5, 5, TFT_TRANSPARENT);
}

// =========================================================================
// Get coordinates of end of a line, pivot at x,y, length r, angle a
// =========================================================================
// Coordinates are returned to caller via the xp and yp pointers
#define DEG2RAD 0.0174532925
void getCoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a) {
  float sx1 = cos((a - 90) * DEG2RAD);
  float sy1 = sin((a - 90) * DEG2RAD);
  *xp = sx1 * r + x;
  *yp = sy1 * r + y;
}

void syncTime(void) {
  targetTime = millis() + 100;
  rtc.getTime(&timeStruct);
  time_secs = timeStruct.hours * 3600 + timeStruct.minutes * 60 + timeStruct.seconds;
}

NotoSansBold15.h

remove all those

while(!Serial);

not needed… learn how its supposed to work and adjust the code accordingly
you should write while(!Serial); just after serial begin and tell it what you want it to do while it is waiting for the serial monitor to connect… while !Serial means while the serial port IS NOT connected that is what the excelimtion point means (!)

reduce serial speed to 19200

Serial.begin(115200);

while serial just holds execution of the program until the serial monitor is connected, otherwise it will be all over and done with before you ever see it

Changed the code like this, still shows SD FAILED:

#include <Arduino.h>
#include <TFT_eSPI.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include "Adafruit_BME680.h"
#include <SD.h>

#define SEALEVELPRESSURE_HPA (1013.25)

#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
#include "esp_wifi.h"
#include "WiFi.h"
const char *ntpServer = "time.cloudflare.com";
const char *ssid = "Adith";
const char *password = "aadithsp";
#endif

#include "I2C_BM8563.h"
#include "NotoSansBold15.h"

I2C_BM8563 rtc(I2C_BM8563_DEFAULT_ADDRESS, Wire);
I2C_BM8563_TimeTypeDef timeStruct;
I2C_BM8563_DateTypeDef dateStruct;
Adafruit_BME680 bme;        // Create a BME680 sensor object for I2C
TFT_eSPI tft = TFT_eSPI();  // Invoke library, pins defined in User_Setup.h
TFT_eSprite face = TFT_eSprite(&tft);
File myFile;
#define CLOCK_X_POS 10
#define CLOCK_Y_POS 10

#define CLOCK_FG TFT_SKYBLUE
#define CLOCK_BG TFT_NAVY
#define SECCOND_FG TFT_RED
#define LABEL_FG TFT_GOLD

#define CLOCK_R 230.0f / 2.0f  // Clock face radius (float type)
#define H_HAND_LENGTH CLOCK_R / 2.0f
#define M_HAND_LENGTH CLOCK_R / 1.4f
#define S_HAND_LENGTH CLOCK_R / 1.3f

#define FACE_W CLOCK_R * 2 + 1
#define FACE_H CLOCK_R * 2 + 1

// Calculate 1 second increment angles. Hours and minute hand angles
// change every second so we see smooth sub-pixel movement
#define SECOND_ANGLE 360.0 / 60.0
#define MINUTE_ANGLE SECOND_ANGLE / 60.0
#define HOUR_ANGLE MINUTE_ANGLE / 12.0

// Sprite width and height
#define FACE_W CLOCK_R * 2 + 1
#define FACE_H CLOCK_R * 2 + 1

// Time h:m:s
uint8_t h = 0, m = 0, s = 0;

float time_secs = h * 3600 + m * 60 + s;

// Time for next tick
uint32_t targetTime = 0;
int memory_status = 0;
// =========================================================================
// Setup
// =========================================================================
void setup() {
  Serial.begin(19200);
  while (!Serial);
  Serial.println("Booting...");

  // Initialise the screen
  tft.init();

  // Ideally set orientation for good viewing angle range because
  // the anti-aliasing effectiveness varies with screen viewing angle
  // Usually this is when screen ribbon connector is at the bottom
  tft.setRotation(0);
  tft.fillScreen(TFT_BLACK);

  // Create the clock face sprite
  //face.setColorDepth(8); // 8 bit will work, but reduces effectiveness of anti-aliasing
  face.createSprite(FACE_W, FACE_H);

  // Only 1 font used in the sprite, so can remain loaded
  face.loadFont(NotoSansBold15);

  // Draw the whole clock - NTP time not available yet
  renderFace(time_secs);

#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
  WiFi.begin(ssid, password);
  for (int a = 0; a < 10; a++) {
    if (WiFi.status() != WL_CONNECTED) {
      delay(500);
      Serial.print("\nWaiting for WiFi Connection...");
    }
    delay(500);
  }
  delay(1000);
  if (WiFi.status() == WL_CONNECTED) {
    Serial.print("\nWiFi Successfully Connected!");
  } else {
    Serial.print("\nWiFi Connection Failed");
  }
  configTime(8 * 3600, 0, ntpServer);
  struct tm timeInfo;
  if (getLocalTime(&timeInfo)) {
    timeStruct.hours = timeInfo.tm_hour;
    timeStruct.minutes = timeInfo.tm_min;
    timeStruct.seconds = timeInfo.tm_sec;
    rtc.setTime(&timeStruct);
    // dateStruct.weekDay = timeInfo.tm_wday;
    // dateStruct.month   = timeInfo.tm_mon + 1;
    // dateStruct.date    = timeInfo.tm_mday;
    // dateStruct.year    = timeInfo.tm_year + 1900;
    // rtc.setDate(&dateStruct);
  }
#endif

  Wire.begin();
  rtc.begin();
  syncTime();
  ////////////////////////////////////////////////////////sensor and sd card
  // while (!Serial)
  //   ;
  Serial.println(F("\nBME688 test"));
  //delay(1000);
  if (!bme.begin()) {
    Serial.println("\nCould not find a valid BME688 sensor, check wiring!");
    while (1)
      ;  // Stay in a loop if the sensor is not found
  }
  // Configure sensor settings
  bme.setTemperatureOversampling(BME680_OS_8X);
  bme.setHumidityOversampling(BME680_OS_2X);
  bme.setPressureOversampling(BME680_OS_4X);
  bme.setIIRFilterSize(BME680_FILTER_SIZE_3);
  bme.setGasHeater(320, 150);  // 320°C for 150 ms
  ///////////////////////////////////////////////////////////////////
  // Open serial communications and wait for port to open:

  // while (!Serial)
  //   ;

  Serial.print("Initializing SD card... \n");

  pinMode(D2, OUTPUT);
  if (!SD.begin(D2)) {
    Serial.println("initialization failed! \n");
    memory_status = 0;
    return;
  }
  Serial.println("initialization done.");
  memory_status = 1;
}

// =========================================================================
// Loop
// =========================================================================
void loop() {
  callfunction();
  // Update time periodically
  if (targetTime < millis()) {

    // Update next tick time in 100 milliseconds for smooth movement
    targetTime = millis() + 100;

    // Increment time by 100 milliseconds
    time_secs += 0.100;

    // Midnight roll-over
    if (time_secs >= (60 * 60 * 24)) time_secs = 0;

    // All graphics are drawn in sprite to stop flicker
    renderFace(time_secs);

    // syncTime();
  }
}
// =========================================================================
//call function
// =========================================================================
void callfunction() {
  //////////////////////////////////////////////////////rtc function
  I2C_BM8563_DateTypeDef dateStruct;
  I2C_BM8563_TimeTypeDef timeStruct;
  // Get RTC
  rtc.getDate(&dateStruct);
  rtc.getTime(&timeStruct);
  // Print RTC
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
  Serial.printf("%04d/%02d/%02d %02d:%02d:%02d\n",
                dateStruct.year,
                dateStruct.month,
                dateStruct.date,
                timeStruct.hours,
                timeStruct.minutes,
                timeStruct.seconds);
#endif
  delay(0);
  /////////////////////////////////////////////sensor function
  if (!bme.performReading()) {
    //Serial.println("Failed to perform reading :(");
    return;
  }
  Serial.print("Temperature = " + String(bme.temperature) + "°C \n");
  Serial.print("Humidity = " + String(bme.humidity) + "% \n");
  Serial.print("Gas = " + String(bme.gas_resistance / 1000.0) + "KOhms \n");
  //////////////////////////////////////////////////// sd card write function
  if (memory_status == 1) {

    myFile = SD.open("/test.txt", FILE_WRITE);
    // if the file opened okay, write to it:
    if (myFile) {
      Serial.print("Writing to test.txt... \n");
      myFile.println(dateStruct.year);
      myFile.println(dateStruct.month);
      myFile.println(dateStruct.date);
      myFile.println(timeStruct.hours);
      myFile.println(timeStruct.minutes);
      myFile.println(timeStruct.seconds);
      // close the file:
      myFile.close();
      Serial.println("Time Sensor done. \n");

    } else {
      // if the file didn't open, print an error:
      Serial.println("error opening test.txt");
    }
  } else {
    Serial.print("SD Failed \n");
  }
  // // re-open the file for reading:
  // myFile = SD.open("/test.txt");
  // if (myFile) {
  //   Serial.println("test.txt:");

  //   // read from the file until there's nothing else in it:
  //   while (myFile.available()) {
  //     Serial.write(myFile.read());
  //   }
  //   // close the file:
  //   myFile.close();
  // } else {
  //   // if the file didn't open, print an error:
  //   Serial.println("error opening test.txt");
  // }
}
// =========================================================================
// Draw the clock face in the sprite
// =========================================================================
static void renderFace(float t) {
  float h_angle = t * HOUR_ANGLE;
  float m_angle = t * MINUTE_ANGLE;
  float s_angle = t * SECOND_ANGLE;

  // The face is completely redrawn - this can be done quickly
  face.fillSprite(TFT_BLACK);

  // Draw the face circle
  face.fillSmoothCircle(CLOCK_R, CLOCK_R, CLOCK_R, CLOCK_BG);

  // Set text datum to middle centre and the colour
  face.setTextDatum(MC_DATUM);

  // The background colour will be read during the character rendering
  face.setTextColor(CLOCK_FG, CLOCK_BG);

  // Text offset adjustment
  constexpr uint32_t dialOffset = CLOCK_R - 10;

  float xp = 0.0, yp = 0.0;  // Use float pixel position for smooth AA motion

  // Draw digits around clock perimeter
  for (uint32_t h = 1; h <= 12; h++) {
    getCoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12);
    face.drawNumber(h, xp, 2 + yp);
  }

  // Add text (could be digital time...)
  face.setTextColor(LABEL_FG, CLOCK_BG);
  face.drawString("DePaul", CLOCK_R, CLOCK_R * 0.75);

  // Draw minute hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);

  // Draw hour hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG);
  face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG);

  // Draw the central pivot circle
  face.fillSmoothCircle(CLOCK_R, CLOCK_R, 4, CLOCK_FG);

  // Draw cecond hand
  getCoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle);
  face.drawWedgeLine(CLOCK_R, CLOCK_R, xp, yp, 2.5, 1.0, SECCOND_FG);
  face.pushSprite(5, 5, TFT_TRANSPARENT);
}

// =========================================================================
// Get coordinates of end of a line, pivot at x,y, length r, angle a
// =========================================================================
// Coordinates are returned to caller via the xp and yp pointers
#define DEG2RAD 0.0174532925
void getCoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a) {
  float sx1 = cos((a - 90) * DEG2RAD);
  float sy1 = sin((a - 90) * DEG2RAD);
  *xp = sx1 * r + x;
  *yp = sy1 * r + y;
}

void syncTime(void) {
  targetTime = millis() + 100;
  rtc.getTime(&timeStruct);
  time_secs = timeStruct.hours * 3600 + timeStruct.minutes * 60 + timeStruct.seconds;
}
![Screenshot 2024-02-10 at 5.14.28 PM|690x412](upload://m4sB9uC1BPtjVOmjLhPib37xjbF.png)


Hi there,
Have you previously "formatted the SD card FAT32 ?
Try that.
HTH
GL :slight_smile: PJ

Yes, I already did that.

Hi there,
Ok , Good. Have you the compiler output of your build? The first 10 lines and the last 25 or so?
Can you post those?
I’ll compare them to the demo I posted with output of the round display and the gif viewer with Xioa esp32C3 driving., SD card was key in getting it to work.
HTH
GL :slight_smile: PJ

Yes, please! Thanks a lot. Here it is -
Complier Output:

Sketch uses 839280 bytes (64%) of program storage space. Maximum is 1310720 bytes.
Global variables use 39748 bytes (12%) of dynamic memory, leaving 287932 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.5.1
Serial port /dev/cu.usbmodem2101
Connecting...
Chip is ESP32-C3 (revision v0.4)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 64:e8:33:00:9b:08
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000e3fff...
Compressed 13200 bytes to 9522...
Writing at 0x00000000... (100 %)
Wrote 13200 bytes (9522 compressed) at 0x00000000 in 0.2 seconds (effective 475.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 439.0 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 630.1 kbit/s)...
Hash of data verified.
Compressed 867280 bytes to 526870...
Writing at 0x00010000... (3 %)
Writing at 0x00018af1... (6 %)
Writing at 0x00024565... (9 %)
Writing at 0x0002d55c... (12 %)
Writing at 0x00036dcb... (15 %)
Writing at 0x0003ca1f... (18 %)
Writing at 0x00042ef3... (21 %)
Writing at 0x000495b9... (24 %)
Writing at 0x0004f4ef... (27 %)
Writing at 0x000566c5... (30 %)
Writing at 0x0005c9b6... (33 %)
Writing at 0x00062c2e... (36 %)
Writing at 0x000688cd... (39 %)
Writing at 0x0006e453... (42 %)
Writing at 0x00074676... (45 %)
Writing at 0x0007a59e... (48 %)
Writing at 0x000801c8... (51 %)
Writing at 0x00085c2a... (54 %)
Writing at 0x0008bcb0... (57 %)
Writing at 0x000914d8... (60 %)
Writing at 0x00097473... (63 %)
Writing at 0x0009d643... (66 %)
Writing at 0x000a31cd... (69 %)
Writing at 0x000a9212... (72 %)
Writing at 0x000af4ea... (75 %)
Writing at 0x000b5956... (78 %)
Writing at 0x000bbc96... (81 %)
Writing at 0x000c219c... (84 %)
Writing at 0x000c7fc9... (87 %)
Writing at 0x000ce233... (90 %)
Writing at 0x000d5d8c... (93 %)
Writing at 0x000dcaa9... (96 %)
Writing at 0x000e2a28... (100 %)
Wrote 867280 bytes (526870 compressed) at 0x00010000 in 6.3 seconds (effective 1109.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Serial Moniter:

19:17:59.738 -> Waiting for WiFi Connection...
19:18:00.728 -> Waiting for WiFi Connection...
19:18:01.751 -> Waiting for WiFi Connection...
19:18:02.741 -> Waiting for WiFi Connection...
19:18:04.227 -> WiFi Connection Failed
19:18:09.239 -> BME688 test
19:18:10.031 -> Initializing SD card... 
19:18:11.022 -> initialization failed! 
19:18:11.022 -> 
19:18:11.022 -> 2024/02/10 19:17:23
19:18:11.384 -> Temperature = 25.10°C 
19:18:11.384 -> Humidity = 28.36% 
19:18:11.384 -> Gas = 155.81KOhms 
19:18:11.384 -> 
19:18:11.384 -> SD Failed 
19:18:11.483 -> 2024/02/10 19:17:24
19:18:11.845 -> Temperature = 25.08°C 
19:18:11.845 -> Humidity = 28.32% 
19:18:11.845 -> Gas = 163.42KOhms 

Hi there, Yes that looks ok, I need to see the first 20 or so lines , please.
where it shows the BSP and file versions .
GL :slight_smile: PJ
I reloaded and it works as it did b4, Definitely the file versions.
here’s what I have…

Hey, could you please tell me how and where to find that?

It’s the first 20 lines or so of the compiler output,
Here’s MineZ. Compare, and Did you do the edits in the “User_Setup_Select.h” in TFT_eSPI .lib?
and move the LVLconf.h to the library root from round display zip?


FQBN: esp32:esp32:XIAO_ESP32C3
Using board 'XIAO_ESP32C3' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11
Using core 'esp32' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11
Detecting libraries used...
C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\riscv32-esp-elf-gcc\esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-g++ -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4.5" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/newlib/platform_include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/freertos/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/freertos/port/riscv/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/freertos/include/esp_additions -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_hw_support/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_hw_support/include/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_hw_support/include/soc/esp32c3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/private_include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/heap/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/log/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/lwip/include/apps -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/lwip/include/apps/sntp -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/lwip/lwip/src/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/lwip/port/esp32/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/lwip/port/esp32/include/arch -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/soc/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/soc/esp32c3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/soc/esp32c3/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/hal/esp32c3/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/hal/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/hal/platform_port/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_rom/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_rom/include/esp32c3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_rom/esp32c3 -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_common/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_system/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_system/port/soc -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_system/port/include/riscv -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_system/port/public_compat -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/riscv/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/driver/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/driver/esp32c3/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/sdk/esp32c3/include/esp_pm/include -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\variants\XIAO_ESP32C3 -Id:\Arduino_projects\libraries\TFT_eSPI -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI\src -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\FS\src -IC:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPIFFS\src C:\Users\Dude\AppData\Local\Temp\arduino\sketches\3114DEBA370654B988B6B20A9A518E26\sketch\sketch_feb10c.ino.cpp -o nul
Alternatives for SD.h: [SD@1.2.4 SD@2.0.0]
ResolveLibrary(SD.h)
  -> candidates: [SD@1.2.4 SD@2.0.0]
Multiple libraries were found for "SD.h"
  Used: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SD
  Not used: C:\Users\Dude\AppData\Local\Arduino15\libraries\SD
Using library TFT_eSPI at version 2.5.23 in folder: D:\Arduino_projects\libraries\TFT_eSPI 
Using library SPI at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPI 
Using library FS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\FS 
Using library SPIFFS at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SPIFFS 
Using library SD at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\SD 
Using library AnimatedGIF at version 1.4.7 in folder: D:\Arduino_projects\libraries\AnimatedGIF 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\riscv32-esp-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\3114DEBA370654B988B6B20A9A518E26/sketch_feb10c.ino.elf"
Sketch uses 326412 bytes (24%) of program storage space. Maximum is 1310720 bytes.
Global variables use 38412 bytes (11%) of dynamic memory, leaving 289268 bytes for local variables. Maximum is 327680 bytes.
"C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe" --chip esp32c3 --port "COM3" --baud 921600  --before default_reset --after hard_reset write_flash  -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x0 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\3114DEBA370654B988B6B20A9A518E26/sketch_feb10c.ino.bootloader.bin" 0x8000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\3114DEBA370654B988B6B20A9A518E26/sketch_feb10c.ino.partitions.bin" 0xe000 "C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\3114DEBA370654B988B6B20A9A518E26/sketch_feb10c.ino.bin" 
esptool.py v4.5.1
Serial port COM3
Connecting...
Chip is ESP32-C3 (revision v0.3)
Features: WiFi, BLE
Crystal is 40MHz
MAC: a0:76:4e:3f:a3:88
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00064fff...
Compressed 13216 bytes to 9528...
Writing at 0x00000000... (100 %)
Wrote 13216 bytes (9528 compressed) at 0x00000000 in 0.3 seconds (effective 410.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.1 seconds (effective 436.2 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 618.7 kbit/s)...
Hash of data verified.
Compressed 347072 bytes to 199313...
Writing at 0x00010000... (7 %)
Writing at 0x000197a6... (15 %)
Writing at 0x00023e09... (23 %)
Writing at 0x0002a525... (30 %)
Writing at 0x00030960... (38 %)
Writing at 0x00036fa8... (46 %)
Writing at 0x0003da46... (53 %)
Writing at 0x000439e0... (61 %)
Writing at 0x000497df... (69 %)
Writing at 0x0004f488... (76 %)
Writing at 0x000551aa... (84 %)
Writing at 0x0005cd53... (92 %)
Writing at 0x00063c33... (100 %)
Wrote 347072 bytes (199313 compressed) at 0x00010000 in 2.8 seconds (effective 1002.2 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

HTH
GL :slight_smile: PJ

I have added it here. I guess this is the one you are asking? These are the first few files of the compiler output. If it’s anything I’m using latest versions only, of all the libraries and IDE 2.3.0

Yes, I did all these

Does my code works and stores in SD for you?

Hi there,
I commented out the blocking sensor loop, and added wifi credz and Indeed it does…
watch face initially then it starts after connects to wifi.

load:0x403cc710,len:0x918
load:0x403ce710,len:0x25f4
entry 0x403cc710
Booting...

Waiting for WiFi Connection...
WiFi Successfully Connected!
BME688 test

Could not find a valid BME688 sensor, check wiring!
Initializing SD card... 
initialization done.
2000/00/12 00:03:39
Temperature = 0.00°C 
Humidity = 0.00% 
Gas = 0.00KOhms 
Writing to test.txt... 
Time Sensor done. 

2000/00/12 00:03:39
Temperature = 0.00°C 
Humidity = 0.00% 
Gas = 0.00KOhms 
Writing to test.txt... 
Time Sensor done. 


then it goes…

HTH
GL :slight_smile: PJ

yes I also edited the blocking code for no reading… creates a “Test.txt” file and here is the contents.

2000
0
12
0
3
56

Works Well. I’m thinking. Problem is between Keyboard and the Floor… :grinning: :+1:

lmk
GL :slight_smile: PJ

Can you please share as a code instead of bin?

Hi there,
It’s your code that’s posted, I only commented out 2 lines for the sensors I don’t have.
these two,

Serial.println(F("\nBME688 test"));
  //delay(1000);
  if (!bme.begin()) {
    Serial.println("\nCould not find a valid BME688 sensor, check wiring!");
    **//while (1) // here edit to a comment to over jump this sensor**
      ;  // Stay in a loop if the sensor is not found
if (!bme.performReading()) {
    //Serial.println("Failed to perform reading :(");
    **//return; // comment out to skip this lack of reading.**
  }

that’s it… those two so the code keeps running and also YOU MUST have the serial port connected because you have the " while Serial" blocking initially with nothing connected.
I can build a BIN for you to drop on your Xiao and when it works which I’m sure it will.
You can figure out what LIB’s are messing you up, I have a hunch but it’s just that.
The previous bin was wrong , anyway .
I can also drop the Animated gif player bin here and try that, You do know how to load a BIN file , yes/no?
HTH
GL :slight_smile: PJ

Hi there,
Start with this, Keeping in mind the only differences are the LIBs or the other stuff the load as “dependant” Ring any Bells?
So make a folder on your SD card called gif
copy the ‘monkeywink.gif’ to it.
Load the bin (any ESP flash tool will do) , press reset.
If that works you can try the Depaul_target.bin and see if it works for you as well,note I left the to edits in place. also, but you do need to plug in usb port for serial and for your code run.

HTH
GL :slight_smile: PJ
:sleeping:
GifViewer_target.zip (2.2 MB)
DePaul_target.zip (521.2 KB)

lmk when they work , I’ll show you in the morning after church later today where you may have gone wrong.

Is this the one?
And I am not able to load the BIN. I don’t knwo how to do it
I have attached the watch model as well. It also has KE Switch in this model

/private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/hardware -hardware /Users/adith/Library/Arduino15/packages -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/adith/Library/Arduino15/packages -built-in-libraries /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/libraries -libraries /Users/adith/Documents/Arduino/libraries -fqbn=esp32:esp32:XIAO_ESP32C3:CDCOnBoot=default,PartitionScheme=default,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none,EraseFlash=none -vid-pid=0X303A_0X1001 -ide-version=10812 -build-path /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060 -warnings=none -build-cache /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_cache_274737 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32s2-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32s2-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.esptool_py.path=/Users/adith/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1 -prefs=runtime.tools.esptool_py-4.5.1.path=/Users/adith/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1 -prefs=runtime.tools.xtensa-esp32s3-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32s3-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.mkspiffs.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.riscv32-esp-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.riscv32-esp-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.riscv32-esp-elf-gdb.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.riscv32-esp-elf-gdb-11.2_20220823.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.dfu-util.path=/Users/adith/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5 -prefs=runtime.tools.dfu-util-0.11.0-arduino5.path=/Users/adith/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5 -prefs=runtime.tools.mklittlefs.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933 -prefs=runtime.tools.mklittlefs-3.0.0-gnu12-dc7f933.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933 -prefs=runtime.tools.xtensa-esp-elf-gdb.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.xtensa-esp-elf-gdb-11.2_20220823.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.openocd-esp32.path=/Users/adith/Library/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230419 -prefs=runtime.tools.openocd-esp32-v0.12.0-esp32-20230419.path=/Users/adith/Library/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230419 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0 -verbose /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288/TFT_eSPI_Clock.ino
/private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/hardware -hardware /Users/adith/Library/Arduino15/packages -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/tools-builder -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/hardware/tools/avr -tools /Users/adith/Library/Arduino15/packages -built-in-libraries /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/Arduino.app/Contents/Java/libraries -libraries /Users/adith/Documents/Arduino/libraries -fqbn=esp32:esp32:XIAO_ESP32C3:CDCOnBoot=default,PartitionScheme=default,CPUFreq=160,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none,EraseFlash=none -vid-pid=0X303A_0X1001 -ide-version=10812 -build-path /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060 -warnings=none -build-cache /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_cache_274737 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.xtensa-esp32s2-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32s2-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s2-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.esptool_py.path=/Users/adith/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1 -prefs=runtime.tools.esptool_py-4.5.1.path=/Users/adith/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1 -prefs=runtime.tools.xtensa-esp32s3-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32s3-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.mkspiffs.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.riscv32-esp-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.riscv32-esp-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.riscv32-esp-elf-gdb.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.riscv32-esp-elf-gdb-11.2_20220823.path=/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.dfu-util.path=/Users/adith/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5 -prefs=runtime.tools.dfu-util-0.11.0-arduino5.path=/Users/adith/Library/Arduino15/packages/arduino/tools/dfu-util/0.11.0-arduino5 -prefs=runtime.tools.mklittlefs.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933 -prefs=runtime.tools.mklittlefs-3.0.0-gnu12-dc7f933.path=/Users/adith/Library/Arduino15/packages/esp32/tools/mklittlefs/3.0.0-gnu12-dc7f933 -prefs=runtime.tools.xtensa-esp-elf-gdb.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.xtensa-esp-elf-gdb-11.2_20220823.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp-elf-gdb/11.2_20220823 -prefs=runtime.tools.openocd-esp32.path=/Users/adith/Library/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230419 -prefs=runtime.tools.openocd-esp32-v0.12.0-esp32-20230419.path=/Users/adith/Library/Arduino15/packages/esp32/tools/openocd-esp32/v0.12.0-esp32-20230419 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-esp-2021r2-patch5-8.4.0.path=/Users/adith/Library/Arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0 -verbose /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288/TFT_eSPI_Clock.ino
Using board 'XIAO_ESP32C3' from platform in folder: /Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14
Using core 'esp32' from platform in folder: /Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14
bash -c "[ ! -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/partitions.csv ] || cp -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/partitions.csv \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/partitions.csv"
bash -c "[ -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/partitions.csv ] || [ ! -f \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/variants/XIAO_ESP32C3\"/partitions.csv ] || cp \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/variants/XIAO_ESP32C3\"/partitions.csv \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/partitions.csv"
bash -c "[ -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/partitions.csv ] || cp \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14\"/tools/partitions/default.csv \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/partitions.csv"
bash -c "[ -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/bootloader.bin ] && cp -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/bootloader.bin \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/TFT_eSPI_Clock.ino.bootloader.bin || ( [ -f \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/variants/XIAO_ESP32C3\"/bootloader.bin ] && cp \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/variants/XIAO_ESP32C3\"/bootloader.bin \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/TFT_eSPI_Clock.ino.bootloader.bin || \"/Users/adith/Library/Arduino15/packages/esp32/tools/esptool_py/4.5.1\"/esptool --chip esp32c3 elf2image --flash_mode dio --flash_freq 80m --flash_size 4MB -o \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/TFT_eSPI_Clock.ino.bootloader.bin \"/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3\"/bin/bootloader_qio_80m.elf )"
esptool.py v4.5.1
Creating esp32c3 image...
Merged 1 ELF section
Successfully created esp32c3 image.
bash -c "[ ! -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/build_opt.h ] || cp -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_modified_sketch_516288\"/build_opt.h \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/build_opt.h"
bash -c "[ -f \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/build_opt.h ] || : > \"/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060\"/build_opt.h"
bash -c ": > /var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/arduino_build_323060/file_opts"
Detecting libraries used...
/Users/adith/Library/Arduino15/packages/esp32/tools/riscv32-esp-elf-gcc/esp-2021r2-patch5-8.4.0/bin/riscv32-esp-elf-g++ -DHAVE_CONFIG_H "-DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE "-DIDF_VER=\"v4.4.6-dirty\"" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/newlib/platform_include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/freertos/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/freertos/port/riscv/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/freertos/include/esp_additions -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_hw_support/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_hw_support/include/soc -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_hw_support/include/soc/esp32c3 -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3 -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_hw_support/port/esp32c3/private_include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/heap/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/log/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/lwip/include/apps -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/lwip/include/apps/sntp -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/lwip/lwip/src/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/lwip/port/esp32/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/lwip/port/esp32/include/arch -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/soc/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/soc/esp32c3 -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/soc/esp32c3/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/hal/esp32c3/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/hal/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/hal/platform_port/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_rom/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_rom/include/esp32c3 -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_rom/esp32c3 -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_common/include -I/Users/adith/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/tools/sdk/esp32c3/include/esp_system/include -


@PJ_Glasso , I have sent you a personal message as well. Could you please check that as well. Thanks!