SD not initializing in XIAO RoundDisplay with ESP32C3

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"));
  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?
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.

GL :slight_smile: PJ
:sleeping: (2.2 MB) (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/ -dump-prefs -logger=machine -hardware /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -hardware /Users/adith/Library/Arduino15/packages -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -tools /Users/adith/Library/Arduino15/packages -built-in-libraries /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -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 -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/ -compile -logger=machine -hardware /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -hardware /Users/adith/Library/Arduino15/packages -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -tools /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -tools /Users/adith/Library/Arduino15/packages -built-in-libraries /private/var/folders/gv/3b6sk3c155d1xt__5jbxyhv40000gn/T/AppTranslocation/D0FC7FA6-3E94-4183-A552-17B5E757249A/d/ -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 -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 )" 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!

Hi there,
Ok , well I would hold up on posting other code. If you can’t get the Example to run(Animated Gif) your wasting your time and NOT learning anything from the experience only left with “Frustration” as manny go this path…
Do this;
(or check off what you have done and then proceed)

  1. Download ZIPs, Start with
  2. Extract it. (2 files) chimpwink.gif and the GifViewer_target.bin
  3. Make a Folder on the SD card (formatted Fat32) called gif.
  4. Copy the chimpwink.gif file to that directory on the SD card.
    Place SD card into Round Display(set both switches OFF)
  5. Download the ESP32 RF Test tool also Referred to on the Getting Started Xiao ESP32C3 Wiki
    Install it. ( is the current version. This tool is GREAT and a MUST have for any ESP32 programing Shenanigans , you use it to (UPLOAD) the factory BIN (unBrick) or to Flash Production Bins.Testing BLE and WiFi also , but we will use it to put (my dev enviro Compiled GifViewer.bin) on your or Blank hardware. All things being equal it will run, doing two things for you, Verify your hardware is Good and The code you provided is correct. (pointing you to the only area that’s broken) Your dev enviro, BSP, LIB versions, etc… But Now you have a solid starting point.
    Open The Tool, Navigate to the folder with the GifVeiwerTarget.bin file and select it Like the picture.

    set com port etc. Click (START)
    after it uploads , press the reset button on the Xiao. Make sure you open the Serial monitor to the same com port AFTER you upload flash.
    NOTE: The tool will complain about the com port if you have an IDE serial monitor connected to the port(they don’t share nice). FYI.
    Should see the gif load.
    GL :slight_smile: PJ

p.s. after the gif loads and it works, Repeat the file selection but pick the Depaul_target.bin Press (Start) note; you can leave the other file in there just uncheck the select only choosing the file you want to flash. after press Xiao Reset… Should get Clock face and act like the demo I posted above, serial output also. GO!

Do you know how to downlaod and run ESP32 RF Test tool for MacBook?

Hi there,
No I don’t know about MACBook at All.
should all be the same, you can use also.
it’s more command line style
“esptool.exe” --chip esp32c3 --port “COM10” --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB
0x0 “C:~\Target.bin” or something close to that.
any flash tool will work. just flashing the file to the mcu.
GL :slight_smile: PJ

I see this though
Here are some steps to flash an ESP32-C3 with a MacBook:

  1. Download the ESP32 Flashing Tool
  2. Start the Flashing Tool and go to Developer Mode
  3. Load the files in the Download Tool
  4. Set the configurations
  5. Press START

I would find a PC and just install the flash tool only grab the bin and flash it. If it works, Then flash Your "depaulTarget.bin and done! Should work straight away.
LMK :v:

Also worth mentioning, You already have the commands (bash) to flash file from the IDE you have.
In your posted compiler output. It is showing the string just look at that for a template.
subbing the correct BIN file names , GifVeiwerTarget /or DepaulTarget bins.
are you stuck ?

Yea, I havent improved anywhere. Still at the same place :frowning:

In the meantime, The reason your environment is broken is the Dependancies. When you loaded the Sensor or the Graphics is Breaks the TFT_eSPI file, It will ask if you want to install without them or with
I choose the Former(without) only because the wiki states
Note that the lv_conf.h file here is from Seeed_Arduino_RoundDisplay, not from the LVGL library
I saw a couple times it asked to install the LVGL lib which is the thing that breaks the TFT_eSPI but only overlapping the SD .LIB capabilities. OK so how do you fix it?
Starting over would be one way.
But uninstall the LIB’s you are using, go through the download ZIP’s from the GIT hub locations ONLY in the Wiki for round display “getting started”
Edit the User_Setup_Select.h to disable the user setups

//#include <User_Setup.h>           // Default setup is root library folder

and enable the SEEED studio setup

#include <User_Setups/Setup66_Seeed_XIAO_Round.h>  // Setup file for Seeed XIAO with GC9A01 240x240

copy the lv_conf.h file from the Seeed Round display master Zip or GIT location directly(no other place) to your arduino Libraries folder.
I was using BSP 2.0.8 but 2.0.11 also is working and is what’s in the target BIN’s
I also specifically used the older TFT_eSPI by bodmer @ 2.5.0, however the latest one works very well too 2.5.23
BME680 ver 2.0.4, adafruit Sensor 1.1.14, I2C_BM8563. 1.0.4
check you IDE LIB’s installed , only install what you need and no dependencies that mention graphics.
GL :slight_smile: PJ

I have already done these modifications and I’m using the same lib versions. I’m able to get the watch work. That’s no issue. I’m just not able to store it in the SD card.

You getting any serial output?
is the Volume name of the SD card “SEEEDSD”


No errors.

Sketch uses 839188 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. v4.5.1
Serial port /dev/cu.usbmodem101
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
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 465.2 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 396.3 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 624.2 kbit/s)...
Hash of data verified.
Compressed 867152 bytes to 526802...
Writing at 0x00010000... (3 %)
Writing at 0x00018a73... (6 %)
Writing at 0x00024550... (9 %)
Writing at 0x0002d52e... (12 %)
Writing at 0x00036db4... (15 %)
Writing at 0x0003ca0c... (18 %)
Writing at 0x00042eb0... (21 %)
Writing at 0x0004959e... (24 %)
Writing at 0x0004f4bc... (27 %)
Writing at 0x00056696... (30 %)
Writing at 0x0005c994... (33 %)
Writing at 0x00062c00... (36 %)
Writing at 0x000688ad... (39 %)
Writing at 0x0006e44d... (42 %)
Writing at 0x00074658... (45 %)
Writing at 0x0007a574... (48 %)
Writing at 0x00080187... (51 %)
Writing at 0x00085bfc... (54 %)
Writing at 0x0008bc73... (57 %)
Writing at 0x000914a7... (60 %)
Writing at 0x00097434... (63 %)
Writing at 0x0009d60a... (66 %)
Writing at 0x000a3181... (69 %)
Writing at 0x000a91d1... (72 %)
Writing at 0x000af4b7... (75 %)
Writing at 0x000b5916... (78 %)
Writing at 0x000bbc90... (81 %)
Writing at 0x000c2166... (84 %)
Writing at 0x000c7fb0... (87 %)
Writing at 0x000ce1fe... (90 %)
Writing at 0x000d5d64... (93 %)
Writing at 0x000dca8b... (96 %)
Writing at 0x000e2a37... (100 %)
Wrote 867152 bytes (526802 compressed) at 0x00010000 in 6.3 seconds (effective 1105.3 kbit/s)...
Hash of data verified.

Hard resetting via RTS pin...

Serial Monitor:

Waiting for WiFi Connection...
Waiting for WiFi Connection...
Waiting for WiFi Connection...
Waiting for WiFi Connection...
Waiting for WiFi Connection...
WiFi Connection Failed
BME688 test
Initializing SD card... 
initialization failed! 

2024/02/11 18:02:35
Temperature = 25.08°C 
Humidity = 26.30% 
Gas = 139.85KOhms 

SD Failed 
2024/02/11 18:02:36
Temperature = 25.05°C 
Humidity = 26.27% 
Gas = 147.34KOhms 

It’s XIAO_TEST. It doesn’t work if I change the name.

Man that’s too F’n close… Should work, I’m sure you are puzzled. I’am? :face_with_peeking_eye:
You need to figure out how to drop my bin on it …Some how.
That will at least prove if the sd is bad or NOT. either bin.
my switches are off also? no ke switch on.
where you at? I’m in Hollywood,Florida.
mac book Pro or air?
GL :slight_smile: PJ

I even tried it with SD_Test. It doesn’t work.

But it worked once yesterday and after that it doesn’t

I’m using MacBook Pro, and I’m at Chicago!

you tried remove the while serial statement in the setup function.

void setup() {
  //while (!Serial); // comment this out.
delay (2000); //add this

Dam Rush Street comes to mind, fine times … got my first Ovation Guitar from a place there under the Train tracks. A very good friend worked in the County Tax appraisers’ office. I was in route to Turkey for a 3 year contract with DOD on a Radar base. as we say back in the DAY!

Did that now, still not Storing in SD, Failed.

ok , just a straw and it allows it to work without the serial port attached.
magnifying glass and look in to the sd slot… if you can. does it look ok? all the pins flat and present?
you tried other SD cards right?
looks like the niner’s if you ask me… LOL :smile:
now it looks like the chiefs… :face_with_hand_over_mouth: