esp32/boards: Add GENERIC_C3_USB board with USB serial/JTAG support.

Add a new board type for ESP32-C3 revision 3 and up that implement 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.  Also pins 14-17
  are 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.
This commit is contained in:
Patrick Van Oosterwijck
2021-08-26 12:19:46 -06:00
committed by Damien George
parent 3720a570f2
commit a66bd7a489
9 changed files with 174 additions and 4 deletions

View File

@@ -125,12 +125,17 @@ STATIC const machine_pin_obj_t machine_pin_obj[] = {
{{&machine_pin_type}, GPIO_NUM_11},
{{&machine_pin_type}, GPIO_NUM_12},
{{&machine_pin_type}, GPIO_NUM_13},
{{&machine_pin_type}, GPIO_NUM_14},
{{&machine_pin_type}, GPIO_NUM_15},
{{&machine_pin_type}, GPIO_NUM_16},
{{&machine_pin_type}, GPIO_NUM_17},
{{NULL}, -1}, // 14 FLASH
{{NULL}, -1}, // 15 FLASH
{{NULL}, -1}, // 16 FLASH
{{NULL}, -1}, // 17 FLASH
#if CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
{{NULL}, -1}, // 18 is for native USB D-
{{NULL}, -1}, // 19 is for native USB D+
#else
{{&machine_pin_type}, GPIO_NUM_18},
{{&machine_pin_type}, GPIO_NUM_19},
#endif
{{&machine_pin_type}, GPIO_NUM_20},
{{&machine_pin_type}, GPIO_NUM_21},