Replies: 1 comment
-
I came here to post this too, strapped for io pins and four are being wasted by uart0 and jtag. Tried and failed to use jtag pins as io even when not using jtag connector. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The ESP32-S2, ESP32-S3, ESP32-C3, and ESP32-C6 chips have native USB device peripherals.
On many boards that use these chips (like Espressif's own
ESP32-C6-DevKitC
,ESP32-S2-DevKitC
andESP32-S3-DevKitC
) there are two USB connectors: one going directly to the MCU's USBD peripheral, and one going to a USB/UART bridge chip that's connected toUART0
'sTXD
andRXD
pins. Other boards that have a single USB port often connect that directly to the MCU chip.There are some boards with these chips (including Espressif's
ESP32-C3-DevKitC
) that use just the UART connection; in Espressif's case the first two revisions of the -C3 chips had broken USB-serial-JTAG controllers so they wired to the UART by default (you can rotate two resistors on this board to use the native USB instead).The
mpconfigboard.h
files for all four of these chips'GENERIC
ports enable the REPL overUART0
:Enabling
MICROPY_HW_ENABLE_UART_REPL
disables the use ofUART0
as a regular UART peripheral, and provides a redundant REPL on the UART USB connector.However, this prevents use of that UART for other purposes (especially for debug or log output).
It seems to me that
MICROPY_HW_ENABLE_UART_REPL
should not be enabled for those boards that have both connectors.If there are any ESP32-S2, ESP32-S3, ESP32-C3, or ESP32-C6 boards that lack the direct USB connection, perhaps these boards should be defined separately, and the
ESP32_S2_GENERIC
,ESP32_S3_GENERIC
,ESP32_C3_GENERIC
, andESP32_C6_GENERIC
ports should not enableMICROPY_HW_ENABLE_UART_REPL
.I know that there was a time where there were two different pre-compiled builds available for some boards (the ESP32-C3?), one with
_USB
appended that used the direct USB and one that did not. Maybe theGENERIC
builds should use direct USB and we could have_GENERIC_NO_USB
builds for those boards that only provide a UART USB connector?PR #15727 contains a lively discussion about the various options for enabling the REPL on USB on these chips. The other REPL options are:
ports/esp32/uart.h
has this logic:ports/esp32/mpconfigport.h
enablesMICROPY_HW_USB_CDC
for all builds that setMICROPY_HW_ENABLE_USBDEV
.Beta Was this translation helpful? Give feedback.
All reactions