Skip to content

Commit

Permalink
docs(advanced-topics): Fixed strapping pin for Automatic Bootloader s…
Browse files Browse the repository at this point in the history
…ection
  • Loading branch information
jakub-kocka authored and dobairoland committed Nov 29, 2023
1 parent cd51bbc commit 590c2c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/en/advanced-topics/boot-mode-selection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Automatic Bootloader

As an example of auto-reset curcuitry implementation, check the `schematic <https://dl.espressif.com/dl/schematics/esp32_devkitc_v4-sch-20180607a.pdf>`_ of the ESP32 DevKitC development board:

- The **Micro USB 5V & USB-UART** section shows the ``DTR`` and ``RTS`` control lines of the USB to serial converter chip connected to ``GPIO0`` and ``EN`` pins of the ESP module.
- The **Micro USB 5V & USB-UART** section shows the ``DTR`` and ``RTS`` control lines of the USB to serial converter chip connected to ``{IDF_TARGET_STRAP_BOOT_GPIO}`` and ``EN`` pins of the ESP module.
- Some OS and/or drivers may activate ``RTS`` and or ``DTR`` automatically when opening the serial port (true only for some serial terminal programs, not ``esptool.py``), pulling them low together and holding the ESP in reset. If ``RTS`` is wired directly to ``EN`` then RTS/CTS "hardware flow control" needs to be disabled in the serial program to avoid this.
An additional circuitry is implemented in order to avoid this problem - if both ``RTS`` and ``DTR`` are asserted together, this doesn't reset the chip. The schematic shows this specific circuit with two transistors and its truth table.
- If this circuitry is implemented (all Espressif boards have it), adding a capacitor between the ``EN`` pin and ``GND`` (in the 1uF-10uF range) is necessary for the reset circuitry to work reliably. This is shown in the **ESP32 Module** section of the schematic.
Expand Down
6 changes: 6 additions & 0 deletions test/test_esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,12 @@ class TestLoadRAM(EsptoolTestCase):

def verify_output(self, expected_out: List[bytes]):
"""Verify that at least one element of expected_out is in serial output"""
# Setting rtscts to true enables hardware flow control.
# This removes unwanted RTS logic level changes for some machines
# (and, therefore, chip resets)
# when the port is opened by the following function.
# As a result, the app loaded to RAM has a chance to run and send
# "Hello world" data without unwanted chip reset.
with serial.serial_for_url(arg_port, arg_baud, rtscts=True) as p:
p.timeout = 5
output = p.read(100)
Expand Down

0 comments on commit 590c2c6

Please sign in to comment.