Fails to upload to ESP32S3-WROOM-1

I am trying to upload to this board

The following configurations build just fine:

[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = arduino
[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

On the USB port no matter what button I press it fails to connect

Uploading .pio/build/esp32-s3-devkitc-1/firmware.bin
esptool.py v4.5.1
Serial port /dev/cu.usbmodem1234561
Connecting......................................

When connected to COM it seems to connect but fails to write:

Serial port /dev/cu.usbmodem57810170451
Connecting....
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: dc:da:0c:10:84:94
Uploading stub...

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)
*** [upload] Error 2

Any suggestions?

Which which Tools → Board and Tools → Upload Method does it work in the Arduino IDE?

I usually don’t use the Arduino IDE.
You mean I should try whether it works with the Arduino IDE as a baseline?

Exactly that.

<post must be at least 20 chars…>

I still need to try the IDE but here are some more details:

$ esptool.py -b 921600 --after no_reset --trace read_mac 
esptool.py v4.7.0
Found 4 serial ports
Serial port /dev/cu.usbmodem57810170451
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.105 No serial data received.
.TRACE +0.055 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes: 
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.011 Read 1 bytes: c0
TRACE +0.000 Read 63 bytes: 
    0108040007071220 00000000c0c00108 | ....... ........
    0400070712200000 0000c0c001080400 | ..... ..........
    0707122000000000 c0c0010804000707 | ... ............
    122000000000c0c0 01080400070712   | . .............
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.004 Read 1 bytes: 20
TRACE +0.000 Read 47 bytes: 
    00000000c0c00108 0400070712200000 | ............. ..
    0000c0c001080400 0707122000000000 | ........... ....
    c0c0010804000707 122000000000c0   | ......... .....
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000
TRACE +0.000 Received full packet: 010804000707122000000000

Detecting chip type...TRACE +0.000 command op=0x14 data len=0 wait_response=1 timeout=3.000 data=
TRACE +0.000 Write 10 bytes: c00014000000000000c0
TRACE +0.005 Read 1 bytes: c0
TRACE +0.000 Read 33 bytes: 
    0114180000000000 0000000000000000 | ................
    0000000c09000000 0000000000000000 | ................
    c0                                | .
TRACE +0.000 Received full packet: 
    0114180000000000 0000000000000000 | ................
    0000000c09000000 0000000000000000 | ................
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=00100040
TRACE +0.000 Write 14 bytes: c0000a04000000000000100040c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000900000000000000c0
TRACE +0.000 Received full packet: 010a04000900000000000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=4cf1ce3f
TRACE +0.000 Write 14 bytes: c0000a0400000000004cf1ce3fc0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000000000000000c0
TRACE +0.000 Received full packet: 010a04000000000000000000
 ESP32-S3
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04006ccc007400000000c0
TRACE +0.000 Received full packet: 010a04006ccc007400000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.009 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04006ccc007400000000c0
TRACE +0.000 Received full packet: 010a04006ccc007400000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=58700060
TRACE +0.000 Write 14 bytes: c0000a04000000000058700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04006ccc007400000000c0
TRACE +0.000 Received full packet: 010a04006ccc007400000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
Chip is ESP32-S3 (QFN56) (revision v0.2)
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=50700060
TRACE +0.000 Write 14 bytes: c0000a04000000000050700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04000000080300000000c0
TRACE +0.000 Received full packet: 010a04000000080300000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=54700060
TRACE +0.000 Write 14 bytes: c0000a04000000000054700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c80e997c00000000c0
TRACE +0.000 Received full packet: 010a0400c80e997c00000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=54700060
TRACE +0.000 Write 14 bytes: c0000a04000000000054700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400c80e997c00000000c0
TRACE +0.000 Received full packet: 010a0400c80e997c00000000
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=44700060
TRACE +0.000 Write 14 bytes: c0000a04000000000044700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a04009484100c00000000c0
TRACE +0.000 Received full packet: 010a04009484100c00000000
TRACE +0.000 command op=0x0a data len=4 wait_response=1 timeout=3.000 data=48700060
TRACE +0.000 Write 14 bytes: c0000a04000000000048700060c0
TRACE +0.003 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 010a0400dadc000000000000c0
TRACE +0.000 Received full packet: 010a0400dadc000000000000
MAC: dc:da:0c:10:84:94
Uploading stub...
TRACE +0.001 command op=0x05 data len=16 wait_response=1 timeout=3.000 data=7c140000010000000018000000803740
TRACE +0.000 Write 26 bytes: 
    c000051000000000 007c140000010000 | .........|......
    0000180000008037 40c0             | .......7@.
TRACE +0.004 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01050400dadc000000000000c0
TRACE +0.000 Received full packet: 01050400dadc000000000000
TRACE +0.000 command op=0x07 data len=5260 wait_response=1 timeout=3.000 data=
    7c14000000000000 0000000000000000 | |...............
    1480036000800360 4800ca3f04800360 | ...`...`H..?...`
    36410081fbff0c49 c020009908c60400 | 6A.....I. ......
    ...
    0300000082a0db80 292387992a0c2229 | ........)#..*.")
    037cf24608000000 22a0dc27990a0c12 | .|.F...."..'....
    29032d0806040000 0082a0dd7cf28799 | ).-.........|...
    060c12290322a0db 1df00000         | ...)."......
TRACE +0.005 Write 5389 bytes: 
    c000078c147e0000 007c140000000000 | .....~...|......
    0000000000000000 0014800360008003 | ............`...
    ...
    0c12290322a0dbdd 1df00000c0       | ..)."........
TRACE +0.475 Read 1 bytes: c0
TRACE +0.000 Read 13 bytes: 01070400dadc000001070000c0
TRACE +0.000 Received full packet: 01070400dadc000001070000

A fatal error occurred: Failed to write to target RAM (result was 01070000: Operation timed out)

I found similar problems on the webs that suggest it could be

  • the macOS USB driver and the M1
  • the USB cable

I just tried on an older Intel mac with the current Arduino IDE.
Setup was super straight forward but it fails with the exact same error.

I haven’t tried a different serial driver yet.
But I would hope that’s not required.

I am using a high quality cable that worked transmitting live video from a camera.
So I hope/think it’s not the cable. But with usb-c it’s always a little mystery.

Any further pointers?

Have you tried a different ESP32S3 board? This one might be genuinely bad.

Unfortunately I only have the one for the moment.
But you might be right it’s time to try get a 2nd one.

Hi,
Try some shorter USB cable.
Or try another USB Port on your PC. Don’t go through USB hub.

Thanks.

I tried other cables. I tried other ports. I tried another computer.
Never through a hub.

Always the same result.

I recently face this issue and the problem was the board config
try another board config (but also S3) i.e. adafruit or so
I think espressif (or someone else) played recently with board configs in Platformio or Arduino for Platformio

1 Like

I have the same board and use the adafruit feather esp32 configuration

I also see you have 16Mbyte version .if you want to use the full memory you will also need to define the partition table . Not too complicated but this is not the thread to sort that out. By default you will build for only 8Mbyte flash.

But given that’s just an esp32 board I assume this would not fully support the S3?
TBH I am not sure at what level they are different.

nod

What’s the process here?
Specifying that just locally or is this that should be added to pio?

The full process would be to copy the json file for the adafruit board to a new name to create a custom board. Update the copy to match the memory configuration and reference the required partition table file.

There are a couple of other lines to add to the ini file to avoid frustration using serial output via the usb…

Most this is not easy to list on a phone response. I would need to use my laptop to explain in full .

For the original upload problem try adafruit feather board as it worked for me .

I just tried

[env:adafruit_feather_esp32s3]
platform = espressif32
board = adafruit_feather_esp32s3
framework = arduino

and

[env:esp32s3box]
platform = espressif32
board = esp32s3box
framework = arduino

and always get the very same error


I have found a brand new ESP32-S3 N16S8 sown in the above image. I am running Platformio on a Windows 10 laptop. Created a new project to test the upload using the Espressif ESP32-S3-DevKitC-1-N8 (8 MB QD, No PSRAM) board (I know the one I have is 16MB with 8MB PSRAM but that should be OK as it will just build with less memory available).

If I just open a Pio Serial Monitor window with the ESP32 plugged into a USB port on the laptop and into the COM port on the ESP32 I get the factory test output:

— Terminal on COM7 | 115200 8-N-1
— Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at Redirecting...
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
␛[0;32mI (16388) example: log → UART␛[0m
example: print → stdout
example: print → stderr
␛[0;32mI (17888) example: log → UART␛[0m
example: print → stdout
example: print → stderr
␛[0;32mI (19388) example: log → UART␛[0m
example: print → stdout
example: print → stderr
␛[0;32mI (20888) example: log → UART␛[0m

The test project ini looks like:

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino

The script:
#include <Arduino.h>

int myFunction(int, int);

void setup() {
Serial.begin(115200);
delay(5000);
Serial.println(“Setup…”);
int result = myFunction(2, 3);
Serial.print(“Result 2+3=”);Serial.println(result);
}

void loop() {
}

int myFunction(int x, int y) {
return x + y;
}

This compiles and successfully uploads. It also runs without problems.

If you are still getting problems consider whether you have the right driver installed on your computer for the UART CH343 in the ESP32 development board. Without a second ESP32 to check the board there is not a lot more suggest.

Thanks for all the effort.

This is what my serial monitor reports:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fcd0108,len:0x15c8
load:0x403b6000,len:0x8c8
load:0x403ba000,len:0x2c04
entry 0x403b61c4
.[0;32mI (24) boot: ESP-IDF v4.4-dev-2594-ga20df743f1-dirty 2nd stage bootloader.[0m
.[0;32mI (25) boot: compile time 16:57:21.[0m
.[0;32mI (25) boot: chip revision: 0.[0m
.[0;32mI (28) boot.esp32s3: SPI Speed      : 80MHz.[0m
.[0;32mI (33) boot.esp32s3: SPI Mode       : DIO.[0m
.[0;32mI (38) boot.esp32s3: SPI Flash Size : 2MB.[0m
.[0;32mI (43) boot: Enabling RNG early entropy source....[0m
.[0;33mW (48) bootloader_random: RNG for ESP32-S3 not currently supported.[0m
.[0;32mI (55) boot: Partition Table:.[0m
.[0;32mI (59) boot: ## Label            Usage          Type ST Offset   Length.[0m
.[0;32mI (66) boot:  0 nvs              WiFi data        01 02 00009000 00006000.[0m
.[0;32mI (73) boot:  1 phy_init         RF data          01 01 0000f000 00001000.[0m
.[0;32mI (81) boot:  2 factory          factory app      00 00 00010000 00100000.[0m
.[0;32mI (88) boot: End of partition table.[0m
.[0;32mI (92) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=090e0h ( 37088) map.[0m
.[0;32mI (108) esp_image: segment 1: paddr=00019108 vaddr=3fc90dd0 size=0253ch (  9532) load.[0m
.[0;32mI (111) esp_image: segment 2: paddr=0001b64c vaddr=40374000 size=049cch ( 18892) load.[0m
.[0;32mI (122) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=1b660h (112224) map.[0m
.[0;32mI (147) esp_image: segment 4: paddr=0003b688 vaddr=403789cc size=08404h ( 33796) load.[0m
.[0;32mI (154) esp_image: segment 5: paddr=00043a94 vaddr=50000000 size=00010h (    16) load.[0m
.[0;32mI (160) boot: Loaded app from partition at offset 0x10000.[0m
.[0;32mI (160) boot: Disabling RNG early entropy source....[0m
.[0;33mW (164) bootloader_random: RNG for ESP32-S3 not currently supported.[0m
.[0;32mI (182) cpu_start: Pro cpu up..[0m
.[0;32mI (182) cpu_start: Starting app cpu, entry point is 0x40375104.[0m
.[0;32mI (0) cpu_start: App cpu up..[0m
.[0;32mI (196) cpu_start: Pro cpu start user code.[0m
.[0;32mI (196) cpu_start: cpu freq: 160000000.[0m
.[0;32mI (196) cpu_start: Application information:.[0m
.[0;32mI (199) cpu_start: Project name:     led_strip.[0m
.[0;32mI (204) cpu_start: App version:      1.[0m
.[0;32mI (209) cpu_start: Compile time:     Aug 17 2021 17:09:47.[0m
.[0;32mI (215) cpu_start: ELF file SHA256:  bda59acbde3f7a0e....[0m
.[0;32mI (221) cpu_start: ESP-IDF:          v4.4-dev-2594-ga20df743f1-dirty.[0m
.[0;32mI (228) heap_init: Initializing. RAM available for dynamic allocation:.[0m
.[0;32mI (235) heap_init: At 3FC94220 len 0004BDE0 (303 KiB): D/IRAM.[0m
.[0;32mI (241) heap_init: At 3FCE0000 len 0000EE34 (59 KiB): STACK/DRAM.[0m
.[0;32mI (248) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM.[0m
.[0;32mI (255) spi_flash: detected chip: generic.[0m
.[0;32mI (259) spi_flash: flash io: dio.[0m
.[0;33mW (263) spi_flash: Detected size(16384k) larger than the size in the binary image header(2048k). Using the size in the binary image header..[0m
.[0;32mI (277) cpu_start: Starting scheduler on PRO CPU..[0m
.[0;32mI (0) cpu_start: Starting scheduler on APP CPU..[0m
.[0;32mI (308) example: LED Rainbow Chase Start.[0m
.[0;32mI (308) example: USB initialization.[0m
.[0;32mI (308) tusb_desc: 
┌─────────────────────────────────┐
│  USB Device Descriptor Summary  │
├───────────────────┬─────────────┤
│bDeviceClass       │ 239         │
├───────────────────┼─────────────┤
│bDeviceSubClass    │ 2           │
├───────────────────┼─────────────┤
│bDeviceProtocol    │ 1           │
├───────────────────┼─────────────┤
│bMaxPacketSize0    │ 64          │
├───────────────────┼─────────────┤
│idVendor           │ 0x303a      │
├───────────────────┼─────────────┤
│idProduct          │ 0x4001      │
├───────────────────┼─────────────┤
│bcdDevice          │ 0x100       │
├───────────────────┼─────────────┤
│iManufacturer      │ 0x1         │
├───────────────────┼─────────────┤
│iProduct           │ 0x2         │
├───────────────────┼─────────────┤
│iSerialNumber      │ 0x3         │
├───────────────────┼─────────────┤
│bNumConfigurations │ 0x1         │
└───────────────────┴─────────────┘.[0m
.[0;32mI (478) TinyUSB: TinyUSB Driver installed.[0m
.[0;32mI (488) example: USB initialization DONE.[0m
.[0;32mI (1388) example: log -> UART.[0m
example: print -> stdout
example: print -> stderr

So, I mean - there is some communication working :man_shrugging:

I do have other ESP32 working - just no ESP32S3 and not the same board.

I usually try to stay vanilla on macOS but maybe worth trying another USB driver before I return the the board.

I have exactly the same board - and because I like it so much, I’ve just ordered a few more.

I use my own board definition: https://github.com/sivar2311/platformio_boards/blob/main/boards/esp32-s3-devkitc1-n16r8.json (simply save it in the boards subfolder) and include it in platformio.ini with board = esp32-s3-devkitc1-n16r8.

But I think all this has nothing to do with the error.
Either it’s a driver problem on the Mac (I’m a Windows user and don’t know much about Mac).
Or it’s simply a faulty board (more likely from what I’ve read so far).

But maybe it’s also a rights problem when accessing the port? (Again, as a Windows user I’m not familiar with this).

Progress!

I managed to find some newer drivers and that seems to have fixed it on the Intel machine.
Now I need to see what to do on the ARM machine.

One thing that is still of seem to be wrong is the LED_BUILTIN.
Does that work for you?

1 Like

I have to admit, I haven’t used them yet. :sweat_smile:
That’s right, LED_BUILTIN and RGB_BUILTIN don’t work properly. :thinking:

But a neopixelWrite(48, red, green, blue); works :blush: