I have attached to the reset gpio of the ESP32 to the mcu monitor TPS3828-33. And have XOR'ed GPIO12 and the RX pin of the ESP32 to the WDI pin of this IC. The RX pin is connected so that I can hopefully upload the firmware to the ESP32. This IC resets the ESP32 if there is no movement on the WDI pin for more than 1.6 seconds.
The thing is that for small binaries (< 1MB) I can upload the firmware with no issues, however if I upload a firmware that is big (> 1MB) I suspect it fails during the md5 hash calculation after writing the binary because it takes longer than the 1.6 seconds. If I disconnect the monitor IC from the reset gpio (by unsoldering a resistor that connects #RST of the IC to the reset of the ESP32), it uploads just fine.
When uploading a small app (with IC connected) it executes successfully:
Code: Select all
esptool.py -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x20000 ../v5/build/main.bin
esptool.py v3.1-dev
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c9:22:f8:c0:e8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00020000 to 0x000f9fff...
Compressed 892480 bytes to 560501...
Wrote 892480 bytes (560501 compressed) at 0x00020000 in 13.1 seconds (effective 545.2 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
Code: Select all
esptool.py -p /dev/ttyUSB0 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x20000 build/main.bin
esptool.py v3.1-dev
Serial port /dev/ttyUSB0
Connecting.....
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c9:22:f8:c0:e8
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00020000 to 0x0011dfff...
Compressed 1038928 bytes to 631037...
Wrote 1038928 bytes (631037 compressed) at 0x00020000 in 14.9 seconds (effective 557.8 kbit/s)...
A fatal error occurred: Timed out waiting for packet content
So my question is, what can I do to avoid the "fatal error" while uploading big binaries ? It seems I cannot disable the hash verification with esptool which I suspect is the process that takes long and holds the chip with no incoming RXD communication. I tried using higher upload speeds. I also tried using 80MHz flash_freq and QIO instead of DIO but nothing seems to make the process faster.