Closed mattbaker-digital closed 3 months ago
I now see that the stub flasher should send back these additional identical sync command responses: https://github.com/espressif/esptool/blob/master/flasher_stub/stub_flasher.c#L233
The official Espressif docs weren't very descriptive about the correct response to a sync command / payload: "The host should wait until it sees a valid response to a SYNC command"
espcomm_sync
inespcomm/espcomm.c
requires a total of 7 SLIP response packets for the function to return as a success. Based on my testing, the ESP device can actually send less than 7 sync command responses. The loop should just be used to throw away any sync command responses (with no minimum), ready for subsequent commands.