QUERY · ISSUE
ESP32C6: USB not in board.json `features` but GPIO pins are disabled anyway
enhancementport-esp32
Description
IMHO the default value for MICROPY_HW_ESP_USB_SERIAL_JTAG should be "is the USB feature turned on in the board.json file".
An even better default might be "micropython checks the EFuse flags and enables the pins iff these flags are set".
The relevant efuse bits are DIS_PAD_JTAG and DIS_USB_JTAG, see tech manual 9.2.4 "JTAG Signal Source Control" page 378/379.
Code Size
No response
Implementation
I would like to sponsor development of this feature
Code of Conduct
Yes, I agree
CANDIDATE · PULL REQUEST
esp32/boards: Add GENERIC_C3_USB.
port-esp32
Add a new board type for ESP32-C3 revision 3 and up that implements the USB serial/JTAG port on pin 18 and 19. This variant uses the USB serial for programming and console, leaving the UART free.
- Pins 18 and 19 are correctly reserved for this variant. I also added pins 14-17 as reserved for flash for any ESP32-C3 so they can't be reconfigured anymore to crash the system.
- Added usb_serial_jtag.c and .h to implement this interface.
- Interface was tested to work correctly together with webrepl.
- Interface was tested to work correctly when sending and receiving large files with ampy.
- Disconnecting terminal or USB will not hang the system when it's trying to print.
- Control+C is working correctly.