Error Flashing ESP32 devices

Hello all, could I please ask for help?

I am trying to flash an ESP32 device but having the “Invalid Header” error.

These are the messages when I flash:
esptool --port COM5 --baud 115200 --after no_reset write_flash --flash_size detect --flash_mode dio 0x00000 C:\Users\Administrator\Downloads\WLED_0.14.1_ESP32.bin

Detecting chip type… ESP32
Chip is ESP32-D0WD-V3 (revision v3.1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 08:d1:f9:26:50:68
Uploading stub…
Running stub…
Stub running…
Configuring flash size…
Auto-detected Flash size: 4MB
Flash will be erased from 0x00000000 to 0x00138fff…
Compressed 1280112 bytes to 849646…
Wrote 1280112 bytes (849646 compressed) at 0x00000000 in 81.2 seconds (effective 126.0 kbit/s)…
Hash of data verified.

When I boot I get this on the serial monitor:

08:54:45.607 → ets Jul 29 2019 12:21:46
08:54:45.607 →
08:54:45.607 → rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
08:54:45.653 → invalid header: 0x6f442c2c
08:54:45.700 → invalid header: 0x6f442c2c
08:54:45.747 → invalid header: 0x6f442c2c
08:54:45.794 → invalid header: 0x6f442c2c
08:54:45.841 → invalid header: 0x6f442c2c
08:54:45.889 → invalid header: 0x6f442c2c
08:54:45.937 → invalid header: 0x6f442c2c
08:54:45.937 → invalid header: 0x6f442c2c

I have a few different ESP32 types but I always get this error.

Interestingly when I flash an esp01 device (using the esp01 image) everything works ok.

I really don’t know what to do next.
Many thanks, Nic.

I have managed to make it work.
I thought that I was probably sending the wrong command so I uploaded the Blink sample to the board and looked at the Arduino command it used to flash it. In the command I replaced the Blink.bin image with the wled.bin and that did it:

C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\tools\esptool_py\4.5.1/esptool.exe --chip esp32 --port COM5 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_204961/Blink.ino.bootloader.bin 0x8000 C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_204961/Blink.ino.partitions.bin 0xe000 C:\Users\Administrator\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11/tools/partitions/boot_app0.bin 0x10000 C:\Users\Administrator\Downloads\WLED_0.14.2-b2_ESP32.bin

So I suppose I need to specify the flash location where to put the image, in my case 0x10000

I also found that I can upload at a much faster speed with no problems!!!

Nic.