ESP32 BAUD Rate - a question of speed.

Post Reply
mnfisher
Valued Contributor
Posts: 375
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 40 times
Been thanked: 206 times

ESP32 BAUD Rate - a question of speed.

Post by mnfisher »

Programming the ESP32 in a code - program - test loop is fairly slow. The 'test' program I am using takes 38.4 seconds to
upload (the compilation time if sdkconfig is changed is several minutes :-( )

So I tried to change the BAUD rate - in theory is should work at 921600 - but I didn't achieve that.

However, I did manage 460800 (upload 9.9s):

I didn't manage to find the correct setting in sdkconfig (though it is surely there - various values just resulted in them changing back..)

So I tweaked esptool.py (in D:\esp-idf\components\esptool_py\esptool on my machine)

Line 268

Code: Select all

    def _set_port_baudrate(self, baud):
        try:
            self._port.baudrate = baud
        except IOError:
I changed to

Code: Select all

    def _set_port_baudrate(self, baud):
        try:
            self._port.baudrate = baud * 4    // Set the speed to 4 * requested :-) 
        except IOError:
This sets the baud rate to 4 * the specified rate and gives the (much reduced) faster load times.

In theory - it should be possible to go to x8 - my laptop couldn't handle this however.. It should be possible to set the rate without the 'tweak' I used....

I get the message
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
WARNING: Detected crystal freq 41.47MHz is quite different to normalized freq 40MHz. Unsupported crystal in use?
Which might explain some of the problems with faster speeds?

Martin

Post Reply