igrr / esptool-ck

ESP8266 build/flash helper tool by Christian Klippel
GNU General Public License v2.0
360 stars 123 forks source link

Flash erase timeout for 3M SPIFFS image #46

Closed mstovenour closed 6 years ago

mstovenour commented 7 years ago

I think it is time to revisit that pesky timeout setting again :) I have an Adafruit HUZZAH with 4M flash. When flashing the SPIFFS at 3M esptool gives up waiting on the flash erase. I can select the 1M SPIFFS configuration in the Arduino IDE and it will work fine. I did a few experiments manually creating SPIFFS binaries then flashing them and found the following: 1M SPIFFS image --> 9 seconds to complete the flash erase 2M SPIFFS image --> 13 seconds to complete the flash erase 3M SPIFFS image --> 18 seconds to complete the flash erase I was able to measure that last one after I cloned master and changed the timeout in the code.

Symptom:

C:\Programs\Eclipse_Neon_2\arduinoPlugin\tools\esp8266\mkspiffs\0.1.2\mkspiffs.exe -c C:\Files\ESP8266\FSBrowser\data -p 256 -b 8192 -s 3125248 C:\Files\ESP8266\FSBrowser\Release\FSBrowser.spiffs-3M.bin
C:\Programs\Eclipse_Neon_2\arduinoPlugin\tools\esp8266\esptool\0.4.9\esptool.exe -vv -cd nodemcu -cb 256000 -cp COM6 -ca 0x100000 -cf C:\Files\ESP8266\FSBrowser\Release\FSBrowser.spiffs-3M.bin
esptool v0.4.9 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
        setting board to nodemcu
        setting baudrate from 115200 to 256000
        setting port from COM1 to COM6
        setting address from 0x00000000 to 0x00100000
        espcomm_upload_file
        espcomm_upload_mem
        setting serial port timeouts to 1000 ms
opening bootloader
resetting board
trying to connect
        flush start
        setting serial port timeouts to 1 ms
        setting serial port timeouts to 1000 ms
        flush complete
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        read 0, requested 1
trying to connect
        flush start
        setting serial port timeouts to 1 ms
        setting serial port timeouts to 1000 ms
        flush complete
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
        espcomm_send_command: receiving 2 bytes of data
Uploading 3125248 bytes from C:\Files\ESP8266\FSBrowser\Release\FSBrowser.spiffs-3M.bin to flash at 0x00100000
        erasing flash
        size: 2fb000 address: 100000
        first_sector_index: 256
        total_sector_count: 763
        head_sector_count: 16
        adjusted_sector_count: 747
        erase_size: 2eb000
        espcomm_send_command: sending command header
        espcomm_send_command: sending command payload
        setting serial port timeouts to 15000 ms
        read 0, requested 1
        setting serial port timeouts to 1000 ms
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
closing bootloader
        flush start
        setting serial port timeouts to 1 ms
        setting serial port timeouts to 1000 ms
        flush complete
error: espcomm_upload_mem failed

Pull request is on it's way.