10x faster flash programming. Source code ESP32ROM.STUB_CODE?

RMandR
Posts: 75
Joined: Mon Oct 29, 2018 3:13 pm

10x faster flash programming. Source code ESP32ROM.STUB_CODE?

Postby RMandR » Wed Feb 08, 2023 3:29 pm

Is it possible to get access to the the stub code for flash programming?

Working on improving the flash programming speed by a few multiples.

The 2232HL chip on ESP_PROG is capable of 12Mbps but there may be other limitations on the flash program process that result in errors such as this one in baud rates over 2.5Mpbs:

A fatal error occurred: Serial data stream stopped: Possible serial noise or corruption.

At 2.5Mbps BAUD, it takes a very long time to flash an encrypted image to modules such as ESP32-WROOM-32E-N16. Considering the fact that the ext flash-chip itself can handle close to 100MHz and compared to other chips on the market, we should be able to get a few fold improvement for the pure flash programming part.

It would be nice to get a head-start with existing stub as opposed to from scratch.

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

Re: 10x faster flash programming. Source code ESP32ROM.STUB_CODE?

Postby ESP_Sprite » Thu Feb 09, 2023 12:24 am

Yes, it's part of esptool. Be aware that running 2.5MBit over a simple serial link might be too much for the serial link hardware; in addition to that, in my experience the flash erase and write times take up a fair amount of the program time, so I'm not sure how much more there is to gain. (Source: the -S2, S3 and C3 can be programmed over USB and should in theory have the full 12MBit of the USB pipe to themselves, but they don't program that much faster.) If you do manage to speed up the process, please share, we're always interested in making the developers experience better.

Who is online

Users browsing this forum: No registered users and 65 guests