-->
Page 1 of 3

New flasher: flash 512K fw in 5 seconds

PostPosted: Mon Mar 21, 2016 9:29 am
by rojer
I wrote a new, better flasher for ESP8266. With the right USB-to-serial adapter, you'll be able to flash 512K firmware in just over 5 seconds, reliably. Somewhat slower if your adapter doesn't support higher baud rates (but still much faster than before).
Grab a modified esptool and use the new --flash_baud option to write_flash with higher rate or use Flash ’n Chips and modify the rate in Settings -> Advanced. For the gory details, read the blog post.

Teaser:

Code: Select all$ time ./esptool.py --port /dev/ttyUSB0 write_flash --flash_baud=4000000 0 test.img
Connecting...
Running Cesanta flasher...
Switching to 4000000 baud...
Writing 524288 @ 0x0... 524288 (100 %)
Wrote 524288 bytes at 0x00000000 in 4.8 seconds (882.3 kbit/s)...
Leaving...

real    0m5.286s


Any questions? Feel free to ask here.

Re: New flasher: flash 512K fw in 5 seconds

PostPosted: Mon Mar 21, 2016 10:58 pm
by wififofum
Looks good. Stub environment could be useful for manufacturing tests and such. Is there any benefit to using larger buffers or is the flash write cycle time not emptying the buffers fast enough to bother? What about core and spi clock rates?

Re: New flasher: flash 512K fw in 5 seconds

PostPosted: Tue Mar 22, 2016 4:22 am
by rojer
better buffer management does provide some benefit - at lower speeds, where performance can be compared directly, my code is 12-15% faster:

at 230K:

Wrote 524288 bytes at 0x00000000 in 26.2 seconds (160.4 kbit/s)...
vs
Wrote 524288 bytes at 0x00000000 in 23.4 seconds (179.5 kbit/s)...

at 460K:

Wrote 524288 bytes at 0x00000000 in 15.4 seconds (272.0 kbit/s)...
vs
Wrote 524288 bytes at 0x00000000 in 13.5 seconds (309.7 kbit/s)...

i have not tested different flash modes/clock speeds yet.

Re: New flasher: flash 512K fw in 5 seconds

PostPosted: Tue Mar 22, 2016 1:10 pm
by cicciocb
Hi, thanks for your great work.
It could be possible to have it in .exe format ?

Thanks in advance

CiccioCB