Maximum Flashing Baud Rate

pctj101
Posts: 23
Joined: Wed Aug 23, 2017 3:20 pm

Maximum Flashing Baud Rate

Postby pctj101 » Mon Jul 27, 2020 3:42 pm

I am having trouble getting flashing to work above an effective 825kbps.

So with a CH340 I was able to set flashing baud to 921600 and it flashes effectively at 850kbps.
Wrote 1388912 bytes (858612 compressed) at 0x00020000 in 13.8 seconds (effective 806.8 kbit/s)...
And with a CP2102N I was able to get the communication rate up to 2000000 (2M) but the effective flashing rate does not improve.
Wrote 1388912 bytes (858612 compressed) at 0x00020000 in 13.5 seconds (effective 825.8 kbit/s)...
At 3000000baud (3M) flashing fails around 66-75% completion.

I tried turning off compression, but that doesn't help.

The fact that 2M baud seems to communicate well, yet flashing only runs at 825.8 kbit/s leads me to believe that there's a bottleneck at the flash writing, but I can't seem to find any documentation of a maximum flashing speed.

Is there anything I can do to speed up the flashing process? :) or have I hit the limit?

Thanks!

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Maximum Flashing Baud Rate

Postby ESP_Angus » Tue Jul 28, 2020 4:18 am

Hi pctj101,

You've probably hit the effective limit caused by the speed of erasing and writing flash. If you know what flash chip model you have then you can look the erase & write times up in the datasheet, but these times are usually specified as a broad range as the erase times get gradually worse as the chip ages (and may vary quite a bit even in new chips).

Regarding the baud rate which works reliably, this is a multiple-variable problem where the inputs are the exact baud rates used by the USB/serial chip (there is usually some error between the requested rate and the actual rate), the accuracy of the driver in setting a correct baud rate (some drivers can be be particularly inaccurate about some values), and the electrical signal integrity of the connection between the USB/serial chip and the ESP32.

As you've found, the actual max baud rate usually becomes a moot point because serial data transfer (especially compressed) becomes "fast enough" that the flash chip is the bottleneck (serial transfer happens at the same time as flash writing). However these factors can explain why 921600bps works well on one USB/serial chip and 1000000bps works better on another.

pctj101
Posts: 23
Joined: Wed Aug 23, 2017 3:20 pm

Re: Maximum Flashing Baud Rate

Postby pctj101 » Tue Jul 28, 2020 6:48 am

Hi thanks for the confirmation.
Yes if I have hit the flash speed limit then so be it!

Have a great day!

Who is online

Users browsing this forum: No registered users and 65 guests