Page 1 of 1

Flash timing

Posted: Tue Sep 26, 2017 8:02 am
by satishiot
Hi Experts ,

Wanted to know is ....

To flash app of 1217936 bytes (663495 compressed) it took 58.9 seconds (effective 165.5 kbit/s). ( Not added bootloader.bin and partition table programming time )

Any Ideas why the programming is so slow (58 seconds).Is the speed of the part itself ( ESP32D0WDQ6 ) ? which is 40MHZ ??

Could this time be sped up considerable? say 10 - 15 sec around or better then this.

The reason I am asking these questions is from production point of view.

satish

Re: Flash timing

Posted: Tue Sep 26, 2017 9:37 am
by ESP_igrr
effective 165.5 kbit/s
You are likely uploading at the default baud rate, 115200. So upload speed is limited by serial connection throughput, not by flash frequency.
If the connections between ESP32 and the USB-UART are short enough, you can try increasing this baud rate. 921600 baud usually works on development boards, some (FT2232- and CP2104-based, at least) are capable of 2-3 Mbaud.
So yes, tenfold improvement is possible if you can increase baud rate.

Re: Flash timing

Posted: Thu Sep 28, 2017 6:06 am
by satishiot
thanks ESP_igrr .
Changing baud to 921600 baud gave following o/p....

Compressed 1217936 bytes to 663495...
Wrote 1217936 bytes (663495 compressed) at 0x00010000 in 14.1 seconds (effective 693.1 kbit/s)...

But when i tried using 2M as baud rate it shows following error ..
Running stub...
Stub running...
Changing baud rate to 2000000
Changed.
Configuring flash size...

A fatal error occurred: Timed out waiting for packet header
make: *** [/c/esp-idf-v2.1/components/esptool_py/Makefile.projbuild:53: flash] Error 2

Im using ESP32WROOM devkit for prototyping and want to optimize flashing time to the best so that we can estimate flash time during production.

Re: Flash timing

Posted: Thu Sep 28, 2017 1:41 pm
by ESP_Sprite
Are you sure your USB-to-serial converter is capable of running at 2MBaud, and your wiring is short enough not to cause capacitance issues with those frequencies?

Edit: ESP32WROOM devkit: do you mean DevkitC or an ESP32-Wroom module?

Re: Flash timing

Posted: Wed Oct 04, 2017 7:42 am
by satishiot
Im using DevkitC .

Re: Flash timing

Posted: Thu Oct 05, 2017 11:00 am
by ESP_Sprite
DevkitC uses an CP2102 converter; that chip unfortunately maxes out at 921.6KBaud.

Re: Flash timing

Posted: Fri Oct 06, 2017 4:28 am
by satishiot
Is it a limitation of the devkitC?

Can the part be programmed though the JTag interface as well?

Re: Flash timing

Posted: Sat Oct 07, 2017 3:26 am
by ESP_Sprite
Yes, it is; the CP2102 on the DevkitC is the bottleneck here. As far as I'm aware, all the JTAG pins are available on this devboard, so using an external JTAG adapter is an option. You may also be able to connect a different USB-to-JTAG converter (CP2104, FT232, ...) to the board and use that to flash faster.

Re: Flash timing

Posted: Sun Nov 19, 2017 3:54 pm
by kolban
I have a WROVER devkit (with WROVER module) which I believe uses the FT2232H USB to UART. When I try and flash at 2000000 baud, I don't see any change as compared to flashing at 921600. The command I am using on Ubuntu hosted on VirtualBox hosted on Windows 10 is:

$ make flash ESPBAUD=2000000

The timing I get are:

921600 = ~8.5 seconds
115200 = ~42 seconds
2000000 = ~8.5 seconds

(all the above for the same flash image ... 910832 uncompressed but 472167 compressed)