Files

39 lines
2.0 KiB
Plaintext

# ESP32-S3 USB CDC-ACM companion support
#
# ESP32-S3 has a DWC2 USB OTG peripheral (snps,dwc2 compatible) that supports
# the Zephyr USB NEXT stack. This conf enables it and turns on the companion
# USB transport on S3 boards. Do NOT use on ESP32 (original) or C3/C6 — those
# chips have no DWC2 controller.
#
# Applied AUTOMATICALLY to companion builds on every S3 board whose board.overlay
# includes esp32s3_usb_otg.dtsi — see the "Auto-include the ESP32-S3 USB CDC-ACM
# companion transport" block in CMakeLists.txt for the gate (companion role only,
# and not on debug builds, which need that port for the console). Pass it by
# hand only to override that policy:
# -DEXTRA_CONF_FILE="boards/common/esp32s3_usb.conf"
#
# NOTE: this takes the USB port away from USB-Serial-JTAG, so esptool's
# auto-reset into download mode stops working on boards flashed over native USB.
# `start dfu` and the 1200-baud touch set FORCE_DOWNLOAD_BOOT to give it back
# (ZephyrBoard::rebootToBootloader); otherwise it is the BOOT button.
#
# Also add the cdc_acm_uart DTS node to the board overlay (the overlays include
# boards/common/esp32s3_usb_otg.dtsi). Without the DT node,
# DT_HAS_COMPAT_STATUS_OKAY(zephyr_cdc_acm_uart) is false and
# zephcore_usbd_init() is compiled out at the #if check.
#
# The same-named esp32s3_usb.overlay is auto-paired with this conf and reroutes
# the console off USB Serial/JTAG onto uart0 — see that file. Keep the pairing
# intact: the reroute must never be applied by a build that does not set the
# Kconfig below, or non-companion roles lose their console and serial CLI.
CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_ZEPHCORE_COMPANION_USB=y
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=n
CONFIG_UART_LINE_CTRL=y
# Disable USB Serial/JTAG so it doesn't fight USB OTG for the D+/D- pins.
# ESP32-S3 has an internal mux — only one controller can own the port at a time.
# With USB companion active, the port IS the companion protocol channel.
CONFIG_ESP_USB_SERIAL_JTAG_ENABLED=n