Skip to content

Commit

Permalink
Merge branch 'espressif:master' into s3_reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason2866 authored Nov 30, 2023
2 parents c3ebec7 + 590c2c6 commit 48fd0e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
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
8 changes: 7 additions & 1 deletion test/test_esptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,13 @@ class TestLoadRAM(EsptoolTestCase):

def verify_output(self, expected_out: List[bytes]):
"""Verify that at least one element of expected_out is in serial output"""
with serial.serial_for_url(arg_port, arg_baud) as p:
# 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)
print(f"Output: {output}")
Expand Down

0 comments on commit 48fd0e4

Please sign in to comment.