diff --git a/README.md b/README.md index b9a84e3..0798fe5 100644 --- a/README.md +++ b/README.md @@ -65,16 +65,16 @@ There is built-in ipv4 only mDNS server. You can access the device using `dap.lo -------------- -| JTAG | | -|--------------------|---------| -| TCK | GPIO6 | -| TMS | GPIO7 | -| TDI | GPIO9 | -| TDO | GPIO8 | -| nTRST \(optional\) | GPIO4 | -| nRESET | GPIO5 | -| TVCC | 3V3 | -| GND | GND | +| JTAG | | +|--------------------|--------| +| TCK | GPIO6 | +| TMS | GPIO7 | +| TDI | GPIO5 | +| TDO | GPIO3 | +| nTRST \(optional\) | GPIO4 | +| nRESET | GPIO10 | +| TVCC | 3V3 | +| GND | GND | @@ -280,6 +280,39 @@ Recv data <- TCP <- Uart Rx <- external devices When the TCP connection is established, bridge will try to resolve the text sent for the first packet. When the text is a valid baud rate, bridge will switch to it. For example, sending the ASCII text `115200` will switch the baud rate to 115200. +
+ESP32C3 + +| | PIN | +|-----|--------| +| RX | GPIO20 | +| TX | GPIO21 | + +
+ + +
+ESP32 + +| | PIN | +|-----|--------| +| RX | GPIO22 | +| TX | GPIO23 | + +
+ +
+ESP32S3 + +| | PIN | +|-----|--------| +| RX | GPIO18 | +| TX | GPIO17 | + + + +
+ ------ ## Credit diff --git a/components/uart_tcp_bridge/uart_tcp_bridge.c b/components/uart_tcp_bridge/uart_tcp_bridge.c index f1d632a..2a3f75d 100644 --- a/components/uart_tcp_bridge/uart_tcp_bridge.c +++ b/components/uart_tcp_bridge/uart_tcp_bridge.c @@ -41,6 +41,25 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #include "uart_tcp_bridge.h" +#if defined CONFIG_IDF_TARGET_ESP32S3 +#define UART_PORT UART_NUM_1 + #define UART_HW (&UART1) + #define PORT_RX_PIN 18 + #define PORT_TX_PIN 17 +#elif defined CONFIG_IDF_TARGET_ESP32C3 + #define UART_PORT UART_NUM_0 + #define UART_HW (&UART0) + #define PORT_RX_PIN 20 + #define PORT_TX_PIN 21 +#elif defined CONFIG_IDF_TARGET_ESP32 +#define UART_PORT UART_NUM_2 + #define UART_HW (&UART2) + #define PORT_RX_PIN 16 + #define PORT_TX_PIN 17 +#else +#error "Unknown target" +#endif + #ifdef CONFIG_IDF_TARGET_ESP8266 #define UART_BRIDGE_TX UART_NUM_0 #define UART_BRIDGE_RX UART_NUM_1 @@ -52,8 +71,8 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND #elif defined CONFIG_IDF_TARGET_ESP32C3 #define UART_BRIDGE_TX UART_NUM_1 #define UART_BRIDGE_RX UART_NUM_1 - #define UART_BRIDGE_TX_PIN 19 - #define UART_BRIDGE_RX_PIN 18 // PIN18 has 50000ns glitch during the power-up + #define UART_BRIDGE_TX_PIN 21 + #define UART_BRIDGE_RX_PIN 20 #elif defined CONFIG_IDF_TARGET_ESP32S3 #define UART_BRIDGE_TX UART_NUM_1 #define UART_BRIDGE_RX UART_NUM_1