Recently, I decided to port the ESPClock project to PlatformIO, and kept encountering an intermittent error during flashing:
A fatal error occurred: Timed out waiting for packet header
Took me a long time to research the issue and making no headway, until I stumbled upon this rare gem.
The file I needed to modify is:
I changed the values to:
DEFAULT_TIMEOUT = 100
START_FLASH_TIMEOUT = 40
CHIP_ERASE_TIMEOUT = 240
MD5_TIMEOUT_PER_MB = 8
ERASE_REGION_TIMEOUT_PER_MB = 60
DEFAULT_SERIAL_WRITE_TIMEOUT = 20
Originally, DEFAULT_TIMEOUT was set to 10. That made flashing the code reliable, but flashing the filesystem was still problematic. After increasing the value all the way to 100, I never encountered the error again.
Post a Comment