From 347884aff5e679f043719ceb226c81b2ab2350be Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 24 Sep 2021 16:10:19 +0200 Subject: [PATCH] docs, cmake: updates for ESP32-S3 DFU support --- docs/en/api-guides/dfu.rst | 14 ++++++++++---- docs/en/api-guides/usb-otg-console.rst | 9 +++++++++ tools/cmake/dfu.cmake | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/docs/en/api-guides/dfu.rst b/docs/en/api-guides/dfu.rst index 3a322c7129..6cfb13ed13 100644 --- a/docs/en/api-guides/dfu.rst +++ b/docs/en/api-guides/dfu.rst @@ -8,7 +8,7 @@ Device Firmware Upgrade through USB Device Firmware Upgrade through USB is not supported with ESP32 chips. Device Firmware Upgrade (DFU) is a mechanism for upgrading the firmware of devices through Universal Serial Bus (USB). -DFU is supported by ESP32-S2 chips. The necessary connections for the USB peripheral are shown in the following table. +DFU is supported by {IDF_TARGET_NAME} chips. The necessary connections for the USB peripheral are shown in the following table. +------+-------------+ | GPIO | USB | @@ -22,8 +22,14 @@ DFU is supported by ESP32-S2 chips. The necessary connections for the USB periph | +5V | +5V (red) | +------+-------------+ +.. only:: esp32s3 + + By default, :doc:`USB_SERIAL_JTAG` module is connected to the internal PHY of the ESP32-S3, while USB_OTG peripheral can be used only if the external USB PHY is connected. Since DFU mode is provided via USB_OTG peripheral, it cannot be used through the internal PHY in this configuration. + + You can permanently switch the internal USB PHY to work with USB_OTG peripheral instead of USB_SERIAL_JTAG by burning ``USB_PHY_SEL`` eFuse. See ESP32-S3 Technical Reference Manual for more details about USB_SERIAL_JTAG and USB_OTG. + .. note:: - The ESP32-S2 chip needs to be in bootloader mode for the detection as a DFU device and flashing. This can be + The {IDF_TARGET_NAME} chip needs to be in bootloader mode for the detection as a DFU device and flashing. This can be achieved by pulling GPIO0 down (e.g. pressing the BOOT button), pulsing RESET down for a moment and releasing GPIO0. @@ -112,8 +118,8 @@ Please see the `libusb wiki `_. Please make sure that the device is in -download mode before running the tool and that it detects the ESP32-S2 device before installing the drivers. The Zadig -tool might detect several USB interfaces of ESP32-S2. Please install the WinUSB driver for only that interface for +download mode before running the tool and that it detects the {IDF_TARGET_NAME} device before installing the drivers. The Zadig +tool might detect several USB interfaces of {IDF_TARGET_NAME}. Please install the WinUSB driver for only that interface for which there is no driver installed (probably it is Interface 2) and don't re-install the driver for the other interface. .. warning:: diff --git a/docs/en/api-guides/usb-otg-console.rst b/docs/en/api-guides/usb-otg-console.rst index 209a708486..5a9812b63d 100644 --- a/docs/en/api-guides/usb-otg-console.rst +++ b/docs/en/api-guides/usb-otg-console.rst @@ -31,6 +31,15 @@ Connect {IDF_TARGET_NAME} to the USB port as follows Some development boards may offer a USB connector for the internal USB peripheral — in that case, no extra connections are required. +.. only:: esp32s3 + + By default, :doc:`USB_SERIAL_JTAG` module is connected to the internal PHY of the ESP32-S3, while USB_OTG peripheral can be used only if the external USB PHY is connected. Since CDC console is provided via USB_OTG peripheral, it cannot be used through the internal PHY in this configuration. + + You can permanently switch the internal USB PHY to work with USB_OTG peripheral instead of USB_SERIAL_JTAG by burning ``USB_PHY_SEL`` eFuse. See ESP32-S3 Technical Reference Manual for more details about USB_SERIAL_JTAG and USB_OTG. + + Note however that USB_SERIAL_JTAG also provides a CDC console, so enabling the CDC console shouldn't be the primary reason for switching from USB_SERIAL_JTAG to USB_CDC. + + Software Configuration ====================== diff --git a/tools/cmake/dfu.cmake b/tools/cmake/dfu.cmake index e86dfbe605..eb45aade84 100644 --- a/tools/cmake/dfu.cmake +++ b/tools/cmake/dfu.cmake @@ -8,7 +8,7 @@ function(__add_dfu_targets) elseif("${target}" STREQUAL "esp32s2") set(dfu_pid "2") elseif("${target}" STREQUAL "esp32s3") - set(dfu_pid "6") + set(dfu_pid "9") elseif("${target}" STREQUAL "esp32c3") return() elseif("${target}" STREQUAL "esp32h2")