espressif / esptool

Espressif SoC serial bootloader utility
https://docs.espressif.com/projects/esptool
GNU General Public License v2.0
5.6k stars 1.39k forks source link

Release DTR after flashing (ESPTOOL-958) #1032

Closed Sejny closed 2 weeks ago

Sejny commented 3 weeks ago

Is your feature request related to a problem?

If you need use same uart pins for flashing firmware in to ESP32 and control different things from same uart from ESP32.

I have used on my custom programming tool DTR for switching TX from programmer or different peripheral. TX from programmer is necessary only when flashing.

Describe the solution you'd like

Release DTR not before start flashing but after flashing.

radimkarnis commented 2 weeks ago

Hello @Sejny,

you can use a configuration file to alter the before and after reset sequences. Defining custom_hard_reset_sequence and custom_reset_sequence allows you to configure DTR and RTS transitions as you like.

We won't be changing the default behavior of esptool, there is a huge risk of bricking the reset sequence for all the other users. I will close this issue now.

Sejny commented 2 weeks ago

@radimkarnis Thank you for help. Config file is nice feature. :)

On windows + platformio + arduino ESP32 esptool dont see config file in esptool folder, after move in to C:\Users\xxxxxx\AppData\Local\esptool custom config start working.

Here is my config for holding DTR during flashning and correct reset after flashing:

[esptool]
chip_erase_timeout = 140
serial_write_timeout = 8.5
connect_attempts = 7
write_block_attempts = 2
reset_delay = 0.75
# Overriding the default reset sequence to work in an abnormal environment
custom_reset_sequence = D0|R1|W0.1|D1|R0|W0.5
custom_hard_reset_sequence = D0|W0.1|R1|W0.5|R0