ESP32S3: cannot flash with Arduino IDE/esptool, but esp-idf works

Hi all, I recently bought a ELEGOO Conqueror Robot Tank kit that came with a ESP32-S3 camera module, and I am having a lot of problems trying to reflash the stock code back onto it after I tried editing it as per the pdf instructions (the instructions in the code are contrary to what the code itself says, there are two different codes for the camera in one downloaded folder but the large zip file with all the code just has one, etc). In my attempts to reflash the chip, I've installed the EspRFTestTool and the Flash Download Tool as well as ESP-IDF to figure out what is going on.

Trying to upload any Arduino sketch:

Sketch uses 2100651 bytes (66%) of program storage space. Maximum is 3145728 bytes.
Global variables use 53544 bytes (16%) of dynamic memory, leaving 274136 bytes for local variables. Maximum is 327680 bytes.
"C:\Users\Bailey\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\2.6.1/esptool.exe" --chip esp32 --port "COM7" --baud 115200  --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xe000 "C:\Users\Bailey\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/partitions/boot_app0.bin" 0x1000 "C:\Users\Bailey\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/bin/bootloader_dio_80m.bin" 0x10000 "C:\Users\Bailey\AppData\Local\Temp\arduino\sketches\CABD2B2B281F341DDB7226E8BE3C8CC9/CameraWebServer.ino.bin" 0x8000 "C:\Users\Bailey\AppData\Local\Temp\arduino\sketches\CABD2B2B281F341DDB7226E8BE3C8CC9/CameraWebServer.ino.partitions.bin"
esptool.py v2.6
Serial port COM7
Connecting....
Traceback (most recent call last):
  File "esptool.py", line 2959, in <module>
  File "esptool.py", line 2952, in _main
  File "esptool.py", line 2653, in main
  File "esptool.py", line 460, in connect
  File "esptool.py", line 440, in _connect_attempt
  File "esptool.py", line 379, in sync
  File "esptool.py", line 322, in command
  File "esptool.py", line 285, in write
  File "site-packages\serial\serialwin32.py", line 323, in write
serial.serialutil.SerialTimeoutException: Write timeout
Failed to execute script esptool
Failed uploading: uploading error: exit status 0xffffffff

After flashing with Flash Download Tool:

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x7 (TG0WDT_SYS_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40043ac8
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x178c
load:0x20c0ff27,len:0x2208a800
Invalid image block, can't boot.
ets_main.c 329

(disconnects and loops this block)

After opening up the ESP-IDF cmd shortcut and navigating to a esp-idf project (in this case a sample "hello world" c program provided by ESP-IDF):

C:\Users\Bailey\Downloads\tank-codes\get-started\hello_world>idf.py flash monitor
Executing action: flash
Serial port COM7
Connecting...
Detecting chip type... ESP32-S3
Running ninja in directory C:\Users\Bailey\Downloads\tank-codes\get-started\hello_world\build
Executing "ninja flash"...
[1/5] cmd.exe /C "cd /D C:\Users\Bailey\Downloads\tank-cod.../tank-codes/get-started/hello_world/build/hello_world.bin"
hello_world.bin binary size 0x35ab0 bytes. Smallest app partition is 0x100000 bytes. 0xca550 bytes (79%) free.
[1/1] cmd.exe /C "cd /D C:\Users\Bailey\Downloads\tank-cod...s/get-started/hello_world/build/bootloader/bootloader.bin"
Bootloader binary size 0x5250 bytes. 0x2db0 bytes (36%) free.
[2/3] cmd.exe /C "cd /D C:\Espressif\frameworks\esp-idf-v5...hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v4.7.0
Serial port COM7
Connecting...
Chip is ESP32-S3 (QFN56) (revision v0.2)
Features: WiFi, BLE, Embedded PSRAM 8MB (AP_3v3)
Crystal is 40MHz
MAC: 30:30:f9:55:84:0c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00005fff...
Flash will be erased from 0x00010000 to 0x00045fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 21072 bytes to 13074...
Writing at 0x00000000... (100 %)
Wrote 21072 bytes (13074 compressed) at 0x00000000 in 0.3 seconds (effective 495.2 kbit/s)...
Hash of data verified.
Compressed 219824 bytes to 111320...
Writing at 0x00010000... (14 %)
Writing at 0x0001e632... (28 %)
Writing at 0x000251e4... (42 %)
Writing at 0x0002b47a... (57 %)
Writing at 0x00032f40... (71 %)
Writing at 0x0003a2dc... (85 %)
Writing at 0x00040515... (100 %)
Wrote 219824 bytes (111320 compressed) at 0x00010000 in 1.6 seconds (effective 1114.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.0 seconds (effective 528.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
D WORKING_DIRECTORY=C:/Users/Bailey/Downloads/tank-codes/get-started/hello_world/build -P C:/Espressif/frameworks/esp-idf-v5.2.1/components/esptool_py/run_serial_tool.cmake"
Executing action: monitor
Running idf_monitor in directory C:\Users\Bailey\Downloads\tank-codes\get-started\hello_world
Executing "C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe C:\Espressif\frameworks\esp-idf-v5.2.1\tools/idf_monitor.py -p COM7 -b 115200 --toolchain-prefix xtensa-esp32s3-elf- --target esp32s3 --revision 0 C:\Users\Bailey\Downloads\tank-codes\get-started\hello_world\build\hello_world.elf --force-color -m 'C:\Espressif\python_env\idf5.2_py3.11_env\Scripts\python.exe' 'C:\Espressif\frameworks\esp-idf-v5.2.1\tools\idf.py'"...
--- WARNING: GDB cannot open serial ports accessed as COMx
--- Using \\.\COM7 instead...
--- esp-idf-monitor 1.4.0 on \\.\COM7 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
I (109) esp_image: segment 1: paddr=0001ce2c vaddr=3fc91eESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x8 (SPI_FAST_FLASH_BOOT)
Saved PC:0x403782ee
0x403782ee: esp_cpu_wait_for_intr at C:/Espressif/frameworks/esp-idf-v5.2.1/components/esp_hw_support/cpu.c:145

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x178c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xcbc
load:0x403cc700,len:0x2da0
entry 0x403c9914
I (26) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (27) boot: compile time Apr 30 2024 14:11:23
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.2
I (34) boot.esp32s3: Boot SPI Speed : 80MHz
I (38) boot.esp32s3: SPI Mode       : DIO
I (43) boot.esp32s3: SPI Flash Size : 2MB
I (48) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (57) boot: ## Label            Usage          Type ST Offset   Length
I (64) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (71) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (79) boot:  2 factory          factory app      00 00 00010000 00100000
I (86) boot: End of partition table
I (91) esp_image: segment 0: paddr=00010020 vaddr=3c020020 size=0ce04h ( 52740) map
I (109) esp_image: segment 1: paddr=0001ce2c vaddr=3fc91e00 size=028c0h ( 10432) load
I (111) esp_image: segment 2: paddr=0001f6f4 vaddr=40374000 size=00924h (  2340) load
I (117) esp_image: segment 3: paddr=00020020 vaddr=42000020 size=18684h ( 99972) map
I (142) esp_image: segment 4: paddr=000386ac vaddr=40374924 size=0d3e0h ( 54240) load
I (160) boot: Loaded app from partition at offset 0x10000
I (161) boot: Disabling RNG early entropy source...
I (172) cpu_start: Multicore app
I (181) cpu_start: Pro cpu start user code
I (181) cpu_start: cpu freq: 160000000 Hz
I (182) cpu_start: Application information:
I (184) cpu_start: Project name:     hello_world
I (190) cpu_start: App version:      1
I (194) cpu_start: Compile time:     Apr 30 2024 14:11:05
I (200) cpu_start: ELF file SHA256:  039283252...
I (206) cpu_start: ESP-IDF:          v5.2.1
I (211) cpu_start: Min chip rev:     v0.0
I (215) cpu_start: Max chip rev:     v0.99
I (220) cpu_start: Chip rev:         v0.2
I (225) heap_init: Initializing. RAM available for dynamic allocation:
I (232) heap_init: At 3FC94F90 len 00054780 (337 KiB): RAM
I (238) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (244) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (250) heap_init: At 600FE010 len 00001FD8 (7 KiB): RTCRAM
I (258) spi_flash: detected chip: gd
I (261) spi_flash: flash io: dio
W (265) spi_flash: Detected size(8192k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (278) sleep: Configure to isolate all GPIO pins in sleep state
I (285) sleep: Enable automatic switching of GPIO sleep configuration
I (292) main_task: Started on CPU0
I (302) main_task: Calling app_main()
Hello world!
This is esp32s3 chip with 2 CPU core(s), WiFi/BLE, silicon revision v0.2, 2MB external flash
Minimum free heap size: 386880 bytes
Restarting in 10 seconds...
Restarting in 9 seconds...
Restarting in 8 seconds...

Done

So basically, esp-idf gives me working flashed code but I want to figure out why I can't upload stuff using esptool and the Arduino IDE. I've done every single troubleshooting step I can think of, I've changed cables, changed computers, disconnected the camera completely from the rest of the tank robot, pressed/held/spammed Boot and Reset buttons, tried different combinations of DIO/QIO and 40mhz and 80mhz for flashing, I'm honestly kind of stuck at this point. Is there something obvious that I'm missing? I will gladly share any additional info if needed. Thanks in advance.

Hi @jetpackjackson ,
Welcome to the forum..

that's a pretty old version, maybe you just need to update that..
espressif/arduino-esp32 core
latest stable release is 2.0.15
arduino-esp32 - latest installing

good luck.. ~q

here's how i got my s3 setup..

maybe it helps.. ~q

I was using that version because that's the version the pdf instructions said to use, and upon further digging, it seems that the facial recognition library changed or something? But I'll try updating it and see what happens!


Screenshot 2024-04-30 155915
I updated the library and reloaded the CamServer example and it looks completely different lol! Which camera model do I choose here, and how do I get the extra menu items like in your menu? I sent a picture of what mine looks like.

Change the Board, currently ESP32 Dev Module..
~q

Aha! There's now a ESP32S3 Dev Module! Didn't see that before, I'll try and see if I can upload now!

1 Like

Leave your partition size at Huge app, probably need the extra space..
~q

Alright! I did that and was able to upload the program:

"C:\Users\Bailey\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe" --chip esp32s3 --port "COM7" --baud 921600  --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 8MB 0x10000 "C:\Users\Bailey\AppData\Local\Temp\arduino\sketches\91CF7B15A089B3BD48B875851EA11BAC/CameraWebServer.ino.bin"
esptool.py v4.5.1
Serial port COM7
Connecting...
Chip is ESP32-S3 (revision v0.2)
Features: WiFi, BLE
Crystal is 40MHz
MAC: 30:30:f9:55:84:0c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00010000 to 0x002e1fff...
Compressed 2956720 bytes to 2073693...
Writing at 0x00010000... (0 %)
Writing at 0x00014498... (1 %)
Writing at 0x0001ab9e... (2 %)
Writing at 0x000261de... (3 %)
Writing at 0x0002be35... (3 %)
Writing at 0x00030234... (4 %)
Writing at 0x0003460e... (5 %)
Writing at 0x00039551... (6 %)
Writing at 0x0003e1e0... (7 %)
Writing at 0x00042d60... (7 %)
Writing at 0x0004792d... (8 %)
Writing at 0x0004c6be... (9 %)
Writing at 0x00051130... (10 %)
Writing at 0x00055537... (11 %)
Writing at 0x00059974... (11 %)
Writing at 0x0005dce3... (12 %)
Writing at 0x00061ed9... (13 %)
Writing at 0x0006632d... (14 %)
Writing at 0x0006a692... (14 %)
Writing at 0x0006fd7e... (15 %)
Writing at 0x000745ba... (16 %)
Writing at 0x00078f3e... (17 %)
Writing at 0x0007d951... (18 %)
Writing at 0x00082258... (18 %)
Writing at 0x00086b24... (19 %)
Writing at 0x0008b3ce... (20 %)
Writing at 0x0008fcef... (21 %)
Writing at 0x0009463d... (22 %)
Writing at 0x00098f14... (22 %)
Writing at 0x0009d7fb... (23 %)
Writing at 0x000a2126... (24 %)
Writing at 0x000a6a75... (25 %)
Writing at 0x000ab3e1... (25 %)
Writing at 0x000b052a... (26 %)
Writing at 0x000b54d7... (27 %)
Writing at 0x000b9c73... (28 %)
Writing at 0x000be4a1... (29 %)
Writing at 0x000c2c37... (29 %)
Writing at 0x000c7540... (30 %)
Writing at 0x000cbef5... (31 %)
Writing at 0x000d0636... (32 %)
Writing at 0x000d4d62... (33 %)
Writing at 0x000d96d8... (33 %)
Writing at 0x000ddf91... (34 %)
Writing at 0x000e26f4... (35 %)
Writing at 0x000e6e61... (36 %)
Writing at 0x000eb89d... (37 %)
Writing at 0x000f0324... (37 %)
Writing at 0x000f4d28... (38 %)
Writing at 0x000f9556... (39 %)
Writing at 0x000fdd62... (40 %)
Writing at 0x001026de... (40 %)
Writing at 0x0010707f... (41 %)
Writing at 0x0010ba7a... (42 %)
Writing at 0x001103a9... (43 %)
Writing at 0x00114c78... (44 %)
Writing at 0x001194f8... (44 %)
Writing at 0x0011de6f... (45 %)
Writing at 0x00122827... (46 %)
Writing at 0x00126fef... (47 %)
Writing at 0x0012b88e... (48 %)
Writing at 0x00130242... (48 %)
Writing at 0x00134a12... (49 %)
Writing at 0x00139166... (50 %)
Writing at 0x0013d978... (51 %)
Writing at 0x00142328... (51 %)
Writing at 0x00146ab6... (52 %)
Writing at 0x0014b1cd... (53 %)
Writing at 0x0014fad0... (54 %)
Writing at 0x001544f4... (55 %)
Writing at 0x00158d77... (55 %)
Writing at 0x0015d523... (56 %)
Writing at 0x00161f45... (57 %)
Writing at 0x00166996... (58 %)
Writing at 0x0016b10a... (59 %)
Writing at 0x0016f91c... (59 %)
Writing at 0x00174232... (60 %)
Writing at 0x00178ab7... (61 %)
Writing at 0x0017d2dd... (62 %)
Writing at 0x001819e7... (62 %)
Writing at 0x001860ba... (63 %)
Writing at 0x0018a828... (64 %)
Writing at 0x0018ef91... (65 %)
Writing at 0x00193875... (66 %)
Writing at 0x0019b92b... (66 %)
Writing at 0x001aef59... (67 %)
Writing at 0x001b97ba... (68 %)
Writing at 0x001bef32... (69 %)
Writing at 0x001c4e38... (70 %)
Writing at 0x001ca74a... (70 %)
Writing at 0x001cfe1a... (71 %)
Writing at 0x001d568e... (72 %)
Writing at 0x001daa5f... (73 %)
Writing at 0x001df952... (74 %)
Writing at 0x001e49ab... (74 %)
Writing at 0x001e97f0... (75 %)
Writing at 0x001ee709... (76 %)
Writing at 0x001f387e... (77 %)
Writing at 0x001fa078... (77 %)
Writing at 0x00200f51... (78 %)
Writing at 0x00208402... (79 %)
Writing at 0x00210359... (80 %)
Writing at 0x0021722b... (81 %)
Writing at 0x0021c99a... (81 %)
Writing at 0x0022332d... (82 %)
Writing at 0x00243375... (83 %)
Writing at 0x0024851b... (84 %)
Writing at 0x0024d769... (85 %)
Writing at 0x00253305... (85 %)
Writing at 0x0025879f... (86 %)
Writing at 0x0025d62a... (87 %)
Writing at 0x0026279a... (88 %)
Writing at 0x00267908... (88 %)
Writing at 0x0026cbef... (89 %)
Writing at 0x002720e9... (90 %)
Writing at 0x0027817f... (91 %)
Writing at 0x0027d62e... (92 %)
Writing at 0x0028420c... (92 %)
Writing at 0x0028d380... (93 %)
Writing at 0x00294f40... (94 %)
Writing at 0x0029bc56... (95 %)
Writing at 0x002a24d8... (96 %)
Writing at 0x002a9afd... (96 %)
Writing at 0x002b2b6e... (97 %)
Writing at 0x002d29db... (98 %)
Writing at 0x002d8df7... (99 %)
Writing at 0x002de994... (100 %)
Wrote 2956720 bytes (2073693 compressed) at 0x00010000 in 20.2 seconds (effective 1171.3 kbit/s)...
Hash of data verified.

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

BUT... the Serial Monitor reads E (520) esp_core_dump_flash: No core dump partition found!
Do I need to configure that somewhere?

the error you're getting shouldn't impact anything, from what I found you can ignore it.

did u put in your wifi credential in the sketch to connect to your network? is it 2.4 ghz ?

I put in my home wifi network, but I can test again with my phone hotspot because I can make sure that it is 2.4ghz (although I initially thought that the code would create a hotspot similar to the stock ELEGOO code lol...). I'll try again and report back soon.

ok I am able to see the camera module in my connected-to-my-hotspot list, but I still only see "No core dump partition found!" in the Serial Monitor, when the code should be outputting more stuff to the monitor. How should I go about fixing this?

i tried to google this but i cant see anyone that includes ESP32-S3 EYE like you uncommented in your sketch. can u upload a picture of the camera board front+rear?

sorry, dinner..
try a different partition scheme maybe..
thinking it's a side effect of using the idf to flash before..
don't think it will stop anything..

is there a github for the code you're using??

~q

Yes in about 30 minutes I can do so

Unfortunately no for the tank code

hmm.. is elegoo-conqueror-robot-tank it??

~q

Yes, that's the kit.


I'll be right back, dinner