GPIO19 and 20 are the USB wires
By default GPIO19 (D-) and GPIO20 (D+) belong to the built-in USB Serial/JTAG port. Turning them into plain GPIOs cuts that USB port off.
Connectivity
A serial port and a debugger on two pins, no adapter needed
runs on the boardLoading the 3D view…
A fixed USB device: a CDC-ACM serial port plus a JTAG adapter for the debugger, on GPIO19 (D-) and 20 (D+).
USB 2.0 full speed only: 12 Mbit/s, not the 480 Mbit/s high speed.
The host can reset the chip and put it into download mode over USB, so no BOOT button is needed.
Using GPIO19/20 as plain GPIOs switches this port off.
By default GPIO19 (D-) and GPIO20 (D+) belong to the built-in USB Serial/JTAG port. Turning them into plain GPIOs cuts that USB port off.
MTCK, MTDO, MTDI and MTMS sit on GPIO39-42. They are free by default, since JTAG goes over USB, but an external debugger needs them.
1 lab uses this block, in 1 track. Open a track to see them.
USB_SERIAL_JTAG_EP1_REGoffset 0x0000| Bits | Field | What it does |
|---|---|---|
| 7:0 | USB_SERIAL_JTAG_RDWR_BYTE | Read a byte from the host, or write one to send (up to 64 per packet). |
USB_SERIAL_JTAG_EP1_CONF_REGoffset 0x0004| Bits | Field | What it does |
|---|---|---|
| 2 | USB_SERIAL_JTAG_SERIAL_OUT_EP_DATA_AVAIL | Bytes from the host waiting. |
| 1 | USB_SERIAL_JTAG_SERIAL_IN_EP_DATA_FREE | Room to write. |
| 0 | USB_SERIAL_JTAG_WR_DONE | Send what was written. |
USB_SERIAL_JTAG_INT_RAW_REGoffset 0x0008| Bits | Field | What it does |
|---|---|---|
| 9 | USB_SERIAL_JTAG_USB_BUS_RESET_INT_RAW | The host reset the bus. |
| 3 | USB_SERIAL_JTAG_SERIAL_IN_EMPTY_INT_RAW | The send buffer is empty. |
| 2 | USB_SERIAL_JTAG_SERIAL_OUT_RECV_PKT_INT_RAW | A packet arrived from the host. |
USB_SERIAL_JTAG_CONF0_REGoffset 0x0018| Bits | Field | What it does |
|---|---|---|
| 14 | USB_SERIAL_JTAG_USB_PAD_ENABLE | USB function on the pads. |
| 9 | USB_SERIAL_JTAG_DP_PULLUP | D+ pull-up: tells the host a device is there. |
| 0 | USB_SERIAL_JTAG_PHY_SEL | 0 internal PHY, 1 external. |
Read the full sectionTechnical reference §33