Error flashing esp32s3

Hi guys,
I have recently purchased 2 XIAO esp32s3’s. I installed micropython on one using this guide. I then decided that I would rather use ardunio code instead, but now I get this error: v4.7.0
Serial port COM16

A fatal error occurred: Failed to connect to ESP32-S3: No serial data received.
For troubleshooting steps visit:

(full log)

I know it should work because the esp32s3 that I did not install micropython on works fine.

Any help would be greatly appreciated.

Hi there,
You will have to put it into Boot loader mode , now to reprogram.
You know how to do that?
It’s a normal error , depending on the environment.
What is it?
GL :slight_smile: PJ

Yes I do know how to put my esp32s3 into bootloader mode (hold down boot button while plugging in), my enviroment is windows 11 using esptool

Hi there,
Well, No not exactly . That technique (what you are describing) is used for 2 special situations. Say’s so HERE…

BootLoader Mode
There are times when we use the wrong program to make XIAO appear to lose ports or not work properly. The specific performance is:

Connected to computer, but no port number found for XIAO.

The computer is connected and the port number appears, but the upload program fails.

When you encounter the above two situations, you can try to put XIAO into BootLoader mode, which can solve most of the problems of unrecognized devices and failed uploads. The specific method is:

Step 1. Press and hold the BOOT button on the XIAO ESP32S3 without releasing it.

Step 2. Keep the BOOT button pressed and then connect to the computer via the data cable. Release the BOOT button after connecting to the computer.

Step 3. Upload the Blink program to check the operation of the XIAO ESP32S3.

Keep reading the wiki , the next section. You’ll see

The Normal way is to Hold the Boot button down and TAP the reset. You don’t unplug Anything.
I mean it does make sense right. Why would you unplug just to Download, Gosh just pressing the button some times is enough, When it get’s bad code :face_with_peeking_eye: do you even need BL mode.
GL :slight_smile: PJ :v:

FWIW, on the serial monitor it will say waiting on Upload , yada , yada the current code will stop running and enumerate the serial port.
Currently , Your ESPtool is losing the com port with all the “…” then error. :wink: :+1:

Still get the same error when following your instructions, could you please explain to me how to use bl mode?

Hi there,
Do you get a " waiting for upload "prompt on serial port it is connected to? after you select it from the List of Boards.
? PJ

No I don’t think I do sorry

here is normal screen and the BL screen notice the stuff.
Does it look like those…?

Normal , and in BL mode

Have you selected the Board?

Yes I have selected the board and nothing comes through on serial monitor but if I use thorny I get a micropython prompt:

Yes, the code is still running. on the xiao.
To stop it you need to hold the boot button down then press the reset , It should stop and prompt you. on the serial mon.
like the second pic

Still no prompt on the serial monitor after I did the buttons, but it does lose connection with thornny

Ok, go look to see if it’s a different serial port available? Select the board, and load some code to compile.

Nope only port 1 and 16:

here’s what I’m using,

#include <U8x8lib.h>
#include <Arduino.h>
U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8(/* reset=*/ U8X8_PIN_NONE);
const int touch_pin = A5;
int LED_pin = 21;
int MTMS_pin = 42;
uint32_t chipId = 0;
uint32_t corez = 0;
void setup(void) {
  delay (1000);
  u8x8.setFlipMode(1);   // set number from 1 to 3, the screen word will rotary 180*
   for(int i=0; i<17; i=i+8) {
	  chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
  corez |=((ESP.getChipCores()));
 u8x8.setCursor(0, 0);
 u8x8.print("Checking Chip");
	Serial.printf("ESP32 Chip model = %s Rev %d\n", ESP.getChipModel(), ESP.getChipRevision());
	Serial.printf("This chip has %d cores\n", ESP.getChipCores());
 u8x8.print("This chip has");u8x8.print(corez);u8x8.print("cores");
  Serial.print("Chip ID: "); Serial.println(chipId);
 u8x8.setCursor(0, 6);
 u8x8.print("Chip ID: "); u8x8.print(chipId);
  // declaring LED pin as output
  pinMode(LED_pin, OUTPUT);
  pinMode(MTMS_pin, OUTPUT);
  delay (2000);
  Serial.print("MOSI: ");
  Serial.print("MISO: ");
  Serial.print("SCK: ");
  Serial.print("SS: ");

Serial.print("Running on Core: ");
void loop(void) {
  Serial.print("Running on Core: ");
  // turn on:
    digitalWrite(LED_pin, HIGH);
    digitalWrite(D2, HIGH);
     digitalWrite(MTMS_pin, HIGH);
    // turn off:
  Serial.print("Touch value: ");
   digitalWrite(LED_pin, LOW);
   digitalWrite(D2, LOW);

Compiler output that matters first 20 or so lines and the last 20 or so…

FQBN: esp32:esp32:XIAO_ESP32S3
Using board 'XIAO_ESP32S3' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8
Using core 'esp32' from platform in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8

cmd /c if exist "D:\\Arduino_projects\\Jtag_Pin_sketch_S3\\partitions.csv" COPY /y "D:\\Arduino_projects\\Jtag_Pin_sketch_S3\\partitions.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD\\partitions.csv"
cmd /c if not exist Using cached library dependencies for file: d:\Arduino_projects\libraries\U8g2\src\U8x8lib.cpp
Alternatives for SPI.h: [SPI@2.0.0]

Successfully created esp32s3 image.
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.8/tools/gen_esp32part.exe" -q "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD/partitions.csv" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD/Jtag_Pin_sketch_S3.ino.partitions.bin"
cmd /c if exist "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD\\libraries\\Insights" "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.8/tools/gen_insights_package.exe" "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD" Jtag_Pin_sketch_S3.ino "D:\\Arduino_projects\\Jtag_Pin_sketch_S3"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\openocd-esp32\\v0.11.0-esp32-20221026\\share\\openocd\\scripts\\board\\esp32s3-builtin.cfg" "D:\\Arduino_projects\\Jtag_Pin_sketch_S3\\debug.cfg"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.8\\tools\\ide-debug\\esp32s3.json" "D:\\Arduino_projects\\Jtag_Pin_sketch_S3\\debug_custom.json"
cmd /c IF 0==1 COPY /y "C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\hardware\\esp32\\2.0.8\\tools\\ide-debug\\svd\\esp32s3.svd" "D:\\Arduino_projects\\Jtag_Pin_sketch_S3\\debug.svd"

Using library U8g2 at version 2.34.22 in folder: D:\Arduino_projects\libraries\U8g2 
Using library SPI at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\SPI 
Using library Wire at version 2.0.0 in folder: C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8\libraries\Wire 
"C:\\Users\\Dude\\AppData\\Local\\Arduino15\\packages\\esp32\\tools\\xtensa-esp32s3-elf-gcc\\esp-2021r2-patch5-8.4.0/bin/xtensa-esp32s3-elf-size" -A "C:\\Users\\Dude\\AppData\\Local\\Temp\\arduino\\sketches\\7644685E6950F98AFB59236ED4B1F5BD/Jtag_Pin_sketch_S3.ino.elf"
Sketch uses 272757 bytes (8%) of program storage space. Maximum is 3342336 bytes.
Global variables use 20164 bytes (6%) of dynamic memory, leaving 307516 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 esp32s3 --port "COM23" --baud 921600  --before default_reset --after hard_reset write_flash  -z --flash_mode dio --flash_freq 80m --flash_size 8MB 0x0 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\7644685E6950F98AFB59236ED4B1F5BD/Jtag_Pin_sketch_S3.ino.bootloader.bin" 0x8000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\7644685E6950F98AFB59236ED4B1F5BD/Jtag_Pin_sketch_S3.ino.partitions.bin" 0xe000 "C:\Users\Dude\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.8/tools/partitions/boot_app0.bin" 0x10000 "C:\Users\Dude\AppData\Local\Temp\arduino\sketches\7644685E6950F98AFB59236ED4B1F5BD/Jtag_Pin_sketch_S3.ino.bin" v4.5.1
Serial port COM23
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 84:fc:e6:6a:d0:f0
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 0x00052fff...
Compressed 15040 bytes to 10333...
Writing at 0x00000000... (100 %)
Wrote 15040 bytes (10333 compressed) at 0x00000000 in 0.2 seconds (effective 515.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 146...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (146 compressed) at 0x00008000 in 0.0 seconds (effective 536.6 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 757.0 kbit/s)...
Hash of data verified.
Compressed 273120 bytes to 152045...
Writing at 0x00010000... (10 %)
Writing at 0x0001ca29... (20 %)
Writing at 0x00024ac7... (30 %)
Writing at 0x0002a0a2... (40 %)
Writing at 0x0002f829... (50 %)
Writing at 0x00034ede... (60 %)
Writing at 0x0003d4ee... (70 %)
Writing at 0x00045f8a... (80 %)
Writing at 0x0004b40f... (90 %)
Writing at 0x00050ece... (100 %)
Wrote 273120 bytes (152045 compressed) at 0x00010000 in 1.9 seconds (effective 1153.9 kbit/s)...
Hash of data verified.

Hard resetting via RTS pin...

I do need to press reset to run the code once it downloads. FYI
the serial output , the code is the touch program that comes installed on it with some SPI pin id stuff and display the cores and chip id. just test code that works always. test the display as well. I’m using it on a XEB.

Build:Mar 27 2021
Saved PC:0x420230ea
mode:DIO, clock div:1
entry 0x403c98d4

ESP32 Chip model = ESP32-S3 Rev 0
This chip has 2 cores
Chip ID: 7000304
SCK: 7
SS: 44
Running on Core: 1
Running on Core: 1
Touch value: 4095
Running on Core: 1
Touch value: 4095
Running on Core: 1

OK so pick the board at least and What is 16?

where do I find “U8x8lib.h”?

16 is 100% my esp32s3

So pick that and the the board type…
It should work if you select it even without the com port.

here’s what I have

I am missing U8x8lib.h

No that’s for the display on expansion board. you don’t have to have it.
comment it out along with u8x8 print’s to display.
if you download it from git or wiki , it will compile as is.
Just add / include lib by ZIP file.