ESP8266 flash loses connection with mos

If you are asking a question, please follow this template:

  1. My goal is to flash the ESP8266 with firmware.

  2. I have expanded the memory to 4MB, and successfully built the firmware for esp8266.
    However, after entering mos flash into the terminal, the flash process fails. The same issue occurs on both my Mac and Windows platform. I have successfully flashed different firmware using Sming though.

  3. The result I see is:

Running flasher @ 921600…
Flasher is running
Flash size: 4194304, params: 0x024f (dio,32m,80m)

I0923 13:58:32.901589 5108 flasher_client.go:346] => 2271; 4096/16384/262144
I0923 13:58:32.901589 5108 slip.go:62] <= (1) 40
W0923 13:58:32.901589 5108 flash.go:216] write error (attempt 1/3): invalid write progress packet “40”
I0923 13:58:32.902586 5108 slip.go:106] => (0)
I0923 13:58:32.902586 5108 flasher_client.go:134] Echo(8) [1178165362]
I0923 13:58:32.903586 5108 slip.go:106] => (1) 08
I0923 13:58:32.903586 5108 slip.go:106] => (4) 72603946
I0923 13:58:32.954598 5108 slip.go:106] => (0)
I0923 13:58:32.954598 5108 flasher_client.go:134] Echo(8) [4169351282]
I0923 13:58:32.954598 5108 slip.go:106] => (1) 08
I0923 13:58:32.955613 5108 slip.go:106] => (4) 724083f8
I0923 13:58:33.006220 5108 slip.go:106] => (0)
I0923 13:58:33.006220 5108 flasher_client.go:134] Echo(8) [4185940958]
I0923 13:58:33.007143 5108 slip.go:106] => (1) 08
I0923 13:58:33.007143 5108 slip.go:106] => (4) de6380f9
I0923 13:58:33.058278 5108 slip.go:106] => (0)
I0923 13:58:33.058278 5108 flasher_client.go:134] Echo(8) [1421372804]
I0923 13:58:33.059200 5108 slip.go:106] => (1) 08
I0923 13:58:33.059200 5108 slip.go:106] => (4) 846db854
I0923 13:58:33.111006 5108 slip.go:106] => (0)
I0923 13:58:33.111006 5108 flasher_client.go:134] Echo(8) [1444939247]
I0923 13:58:33.111949 5108 slip.go:106] => (1) 08
I0923 13:58:33.112925 5108 slip.go:106] => (4) ef052056
I0923 13:58:33.271813 5108 main.go:302] Error: /go/src/github.com/mongoose-os/mos/mos/flash/esp/flasher/flasher_client.go:264: flasher did not respond
/go/src/github.com/mongoose-os/mos/mos/flash/esp/flasher/flash.go:218: lost connection with the flasher
/go/src/github.com/mongoose-os/mos/mos/flash.go:223:
/go/src/github.com/mongoose-os/mos/mos/main.go:196: flash failed
Error: /go/src/github.com/mongoose-os/mos/mos/flash/esp/flasher/flasher_client.go:264: flasher did not respond
/go/src/github.com/mongoose-os/mos/mos/flash/esp/flasher/flash.go:218: lost connection with the flasher
/go/src/github.com/mongoose-os/mos/mos/flash.go:223:
/go/src/github.com/mongoose-os/mos/mos/main.go:196: flash failed

  1. What are some methods I can try to fix this issue?

Try to lower the speed during flashing --esp-baud-rate 115200