0
0
Fork 0

change uart and jtag gpio pin

This commit is contained in:
kerms 2024-06-22 16:39:34 +08:00
parent 5bac7ae67b
commit 9b031581d6
2 changed files with 64 additions and 12 deletions

View File

@ -65,16 +65,16 @@ There is built-in ipv4 only mDNS server. You can access the device using `dap.lo
-------------- --------------
| JTAG | | | JTAG | |
|--------------------|---------| |--------------------|--------|
| TCK | GPIO6 | | TCK | GPIO6 |
| TMS | GPIO7 | | TMS | GPIO7 |
| TDI | GPIO9 | | TDI | GPIO5 |
| TDO | GPIO8 | | TDO | GPIO3 |
| nTRST \(optional\) | GPIO4 | | nTRST \(optional\) | GPIO4 |
| nRESET | GPIO5 | | nRESET | GPIO10 |
| TVCC | 3V3 | | TVCC | 3V3 |
| GND | GND | | GND | GND |
</details> </details>
@ -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. 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. For example, sending the ASCII text `115200` will switch the baud rate to 115200.
<details>
<summary>ESP32C3</summary>
| | PIN |
|-----|--------|
| RX | GPIO20 |
| TX | GPIO21 |
</details>
<details>
<summary>ESP32</summary>
| | PIN |
|-----|--------|
| RX | GPIO22 |
| TX | GPIO23 |
</details>
<details>
<summary>ESP32S3</summary>
| | PIN |
|-----|--------|
| RX | GPIO18 |
| TX | GPIO17 |
</details>
------ ------
## Credit ## Credit

View File

@ -41,6 +41,25 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
#include "uart_tcp_bridge.h" #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 #ifdef CONFIG_IDF_TARGET_ESP8266
#define UART_BRIDGE_TX UART_NUM_0 #define UART_BRIDGE_TX UART_NUM_0
#define UART_BRIDGE_RX UART_NUM_1 #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 #elif defined CONFIG_IDF_TARGET_ESP32C3
#define UART_BRIDGE_TX UART_NUM_1 #define UART_BRIDGE_TX UART_NUM_1
#define UART_BRIDGE_RX UART_NUM_1 #define UART_BRIDGE_RX UART_NUM_1
#define UART_BRIDGE_TX_PIN 19 #define UART_BRIDGE_TX_PIN 21
#define UART_BRIDGE_RX_PIN 18 // PIN18 has 50000ns glitch during the power-up #define UART_BRIDGE_RX_PIN 20
#elif defined CONFIG_IDF_TARGET_ESP32S3 #elif defined CONFIG_IDF_TARGET_ESP32S3
#define UART_BRIDGE_TX UART_NUM_1 #define UART_BRIDGE_TX UART_NUM_1
#define UART_BRIDGE_RX UART_NUM_1 #define UART_BRIDGE_RX UART_NUM_1