Summary
What worked for me after several days of anguish was switching USB to RS323 interfaces
- from FTDI232 (FT232RL), assumed legitimate
- to AiThinker (CH340G)
My symptoms using FTDI: flashing with esptool failed early with some variation of the following
Writing at 0x00009
A fatal error occurred: Failed to write compressed data to flash after seq 2 (result was C100)
I compared what was written before the fail to my "bare" ESP32 and it "matched" the flashing of my ESP32 DevKit module. So some data was getting written.
---
Setup
I had no problems with the Dev.Kit.V1 (has it own onboard interface, Silocon Labs CP210x)
Problems started with 2 "bare" ESP WROOM 32 modules. Just for debug, I mounted the first on an 8 pin header plugged into a breadboard. Connections were made with very short lengths of wirewrap from module to header. ESP suspended in "space" via the 8 wires to the header. Too sloppy to work? Pins brought out: GND, GPIO15, GPIO2, GPIO0, Rx, Tx, Vcc, EN. A difficult solder job, especially ground pin -- I only used 1 of the 3 available.
gnd from RS232 to breadboard
GPIO15 pulled up
GPIO2 pulled down
GPIO0 pulled up, also connected to push button to gnd
Rx to Tx of RS232 to USB to Windows 7 computer
Tx to Rx of RS232
5v from RS232 (straight through from computer) to LDO regulator on breadboard (3.3v). I felt interface did not have sufficient power to drive 3.3v by itself. I did not try.
EN pulled up, also connected to push button to gnd
all pullups/pulldowns in the range of 10-20k, whatever came out of the bin
additionally, breadboard contained some decoupling caps
---
Burn process
power ESP by connecting usb to computer
press and hold boot (flash) button (to bring from high to low)
press and release EN to reset ESP (high, low, high)
start esptool
after flashing % starts, release boot button (to bring high)
for me, the call to python looked like this
..\python c:\esptool\esptool.py -b 115200 --port COM5 write_flash --flash_freq 80m 0x1000 esp32-idf4-20200110-v1.12-45-gbfbd94401.bin
failure with FTDI looked like this
esptool.py v2.8
Serial port COM6
Connecting........__
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:11:ae:cc:10:58
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x022f
Compressed 1408336 bytes to 894584...
Writing at 0x00009000... (5 %)
A fatal error occurred: Failed to write compressed data to flash after seq 2 (result was C100)
Success with AiThinker looked like this
esptool.py v2.8
Serial port COM6
Connecting........__
Detecting chip type... ESP32
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:11:ae:cc:10:58
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 4MB
Flash params set to 0x022f
Compressed 1408336 bytes to 894584...
Writing at 0x00009000... (5 %)
A fatal error occurred: Failed to write compressed data to flash after seq 2 (result was C100)
No other changes were made between AiThinker and FTDI, just swapping out the 4 lines from the USB to RS232 header.
---
I repeated this process on a second "bare" ESP32 mounted on an old wirewrap board with wirewrap to connect to the board pins. All 3 gnd pins tied to the ground plane. 3.3v connected to the power plane. Significant decoupling between gnd and 3.3v very close to the ESP. 0.1 uF from EN to ground. EN and GPIO0 10k chip resistor pullups to Vcc. Relatively "short" Tx and Rx lines. None of this helped with the FTDI.
I tried the RTS and DTR connections to EN and GPIO0, resp. This did not work at all with esptool.
I did not try the 2x transistor and 2x resistor network for EN and GPIO0 timing. I doubt it would have helped since flashing started fine.
I tried -- trace in esptool which had been reported as helping a little bit. This did not help.
I tried changing the priority of esptool in process explorer to "near real time". This did not help.
I have another FTDI and another AI Thinker USB to RS232. I did not try either of those. They are the same vintage as the two I tried.
FYI: Flashing ESP8266s has not been a problem using the FTDI interface.
Hope this helps.
- Flashing Setup
- 200112_022925_Pp.jpg (3.93 MiB) Viewed 23055 times
-