Flash timing

satishiot
Posts: 6
Joined: Fri Sep 22, 2017 11:29 am

Flash timing

Postby satishiot » Tue Sep 26, 2017 8:02 am

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

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Flash timing

Postby ESP_igrr » Tue Sep 26, 2017 9:37 am

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.

satishiot
Posts: 6
Joined: Fri Sep 22, 2017 11:29 am

Re: Flash timing

Postby satishiot » Thu Sep 28, 2017 6:06 am

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.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Flash timing

Postby ESP_Sprite » Thu Sep 28, 2017 1:41 pm

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?

satishiot
Posts: 6
Joined: Fri Sep 22, 2017 11:29 am

Re: Flash timing

Postby satishiot » Wed Oct 04, 2017 7:42 am

Im using DevkitC .

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Flash timing

Postby ESP_Sprite » Thu Oct 05, 2017 11:00 am

DevkitC uses an CP2102 converter; that chip unfortunately maxes out at 921.6KBaud.

satishiot
Posts: 6
Joined: Fri Sep 22, 2017 11:29 am

Re: Flash timing

Postby satishiot » Fri Oct 06, 2017 4:28 am

Is it a limitation of the devkitC?

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

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Flash timing

Postby ESP_Sprite » Sat Oct 07, 2017 3:26 am

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.

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Flash timing

Postby kolban » Sun Nov 19, 2017 3:54 pm

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)
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Who is online

Users browsing this forum: VinayDand and 364 guests