From 0a836e0cfbf709aeac623f189174b29ad36fdd07 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sat, 30 May 2015 22:15:36 +0300 Subject: [PATCH] write_flash: Show actual flash write speed. There're various reports of various port baud speeds non-working (or working), show actual write speed should provide more insight into that. --- esptool.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/esptool.py b/esptool.py index 46b6f135e..cc5f9154c 100755 --- a/esptool.py +++ b/esptool.py @@ -558,6 +558,8 @@ def arg_auto_int(x): blocks = math.ceil(len(image)/float(esp.ESP_FLASH_BLOCK)) esp.flash_begin(blocks*esp.ESP_FLASH_BLOCK, address) seq = 0 + written = 0 + t = time.time() while len(image) > 0: print '\rWriting at 0x%08x... (%d %%)' % (address + seq*esp.ESP_FLASH_BLOCK, 100*(seq+1)/blocks), sys.stdout.flush() @@ -570,7 +572,9 @@ def arg_auto_int(x): esp.flash_block(block, seq) image = image[esp.ESP_FLASH_BLOCK:] seq += 1 - print + written += len(block) + t = time.time() - t + print '\nWritten %d bytes in %.2f seconds (%.2f kbit/s)...' % (written, t, written / t * 8 / 1000) print '\nLeaving...' if args.flash_mode == 'dio': esp.flash_unlock_dio()