0
0
Fork 0
Go to file
kerms 9b031581d6 change uart and jtag gpio pin 2024-06-22 16:39:34 +08:00
.github Update issue templates 2024-05-04 22:51:27 +08:00
components change uart and jtag gpio pin 2024-06-22 16:39:34 +08:00
main fix(ws) concurrent access to websocket 2024-06-22 14:28:48 +08:00
project_components change system api ID to 0 2024-06-22 14:57:34 +08:00
.gitignore change system api ID to 0 2024-06-22 14:57:34 +08:00
CMakeLists.txt feat(chip) add back ESP32 support 2024-04-18 14:39:00 +08:00
LICENSE feat wifi scan using http/json 2024-02-14 16:06:31 +08:00
README.md change uart and jtag gpio pin 2024-06-22 16:39:34 +08:00
README_CN.md revert(uart bridge) reverted temporally, will be completely rewritten in the next release 2024-04-21 15:24:50 +08:00
partitions.csv change system api ID to 0 2024-06-22 14:57:34 +08:00
sdkconfig.defaults feat(esp32): Add support for esp32 2022-09-05 20:54:23 +08:00
sdkconfig.defaults.esp32 fix(http hdr) increase hdr tp 1024 B in case some browser send big header 2024-04-20 13:22:06 +08:00
sdkconfig.defaults.esp32c3 reformat: code cleanup and reformat some API_JSON returns 2024-06-22 14:52:02 +08:00
sdkconfig.defaults.esp32s3 feat(esp32s3) add default sdkconfig 2024-04-20 13:22:01 +08:00

README.md

中文

Introduce

Wireless debugging with only one ESP Chip !

Realized by USBIP and CMSIS-DAP protocol stack.

👉 5m range, 100kb size firmware(Hex) earse and download test:


For Keil users, we now also support elaphureLink. No need for usbip to start your wireless debugging!

Feature

  1. SoC Compatibility

    • ESP32
    • ESP32C3
    • ESP32S3
  2. Debug Communication Mode

    • SWD
    • JTAG
  3. USB Communication Mode

    • USB-HID
    • WCID & WinUSB (Default)
  4. Debug Trace (Uart)

    • Uart TCP Bridge
  5. More..

    • SWD protocol based on SPI acceleration (Up to 40MHz)
    • Support for elaphureLink, fast Keil debug without drivers
    • ...

WIFI

There is built-in ipv4 only mDNS server. You can access the device using dap.local.

mDNS

Debugger

ESP32C3
SWD
SWCLK GPIO6
SWDIO GPIO7
TVCC 3V3
GND GND

JTAG
TCK GPIO6
TMS GPIO7
TDI GPIO5
TDO GPIO3
nTRST optional GPIO4
nRESET GPIO10
TVCC 3V3
GND GND
ESP32
SWD
SWCLK GPIO14
SWDIO GPIO13
TVCC 3V3
GND GND

JTAG
TCK GPIO14
TMS GPIO13
TDI GPIO18
TDO GPIO19
nTRST optional GPIO25
nRESET GPIO26
TVCC 3V3
GND GND
ESP32S3
SWD
SWCLK GPIO12
SWDIO GPIO11
TVCC 3V3
GND GND

JTAG
TCK GPIO12
TMS GPIO11
TDI GPIO10
TDO GPIO9
nTRST optional GPIO14
nRESET GPIO13
TVCC 3V3
GND GND

Build And Flash

You can build locally or use Github Action to build online and then download firmware to flash.

General build and Flash

ESP32C3
  1. Get esp-idf

    For now, please use esp-idf v5.2.1 : https://github.com/espressif/esp-idf/releases/tag/v5.2.1

  2. Build & Flash

    Build with ESP-IDF build system. More information can be found at the following link: Build System

The following example shows a possible way to build:

# Set build target
idf.py set-target esp32c3
# Build
idf.py build
# Flash
idf.py -p /dev/ttyS5 flash

Usage

  1. Get USBIP project
  • Windows: usbip-win .
  • Linux: Distributed as part of the Linux kernel, but we have not yet tested on Linux platform, and the following instructions are all under Windows platform.
  1. Start ESP chip and connect it to the device to be debugged

  2. Connect it with usbip:

# HID Mode only
# for pre-compiled version on SourceForge
# or usbip old version
.\usbip.exe -D -a <your-esp-device-ip-address>  1-1

# 👉 Recommend
# HID Mode Or WinUSB Mode
# for usbip-win 0.3.0 kmdf ude
.\usbip.exe attach_ude -r <your-esp-device-ip-address> -b 1-1

If all goes well, you should see your device connected.

image

Here, we use MDK for testing:

target


FAQ

Keil is showing a "RDDI-DAP ERROR" or "SWD/JTAG Communication Failure" message.

  1. Check your line connection. Don't forget the 3v3 connection cable.
  2. Check that your network connection is stable.

DAP is slow or often abnormal.

Note that this project is sensitive to the network environment. If you are using a hotspot on your computer, you can try using network analyzer such as wireshark to observe the status of your AP network. During the idle time, the network should stay silent, while in the working state, there should be no too much packet loss.

Some LAN broadcast packets can cause serious impact, including:

  • DropBox LAN Sync
  • Logitech Arx Control
  • ...

It is also affected by the surrounding radio environment, your AP situation (some NICs have terrible AP performance), distance, etc.


Document

Speed Strategy

The maximum rate of esp8266 pure IO is about 2MHz. When you select max clock, we will take the following actions:

  • clock < 2Mhz : Similar to the clock speed you choose.
  • 2MHz <= clock < 10MHz : Use the fastest pure IO speed.
  • clock >= 10MHz : SPI acceleration using 40MHz clock.

Note that the most significant speed constraint of this project is still the TCP connection speed.

For OpenOCD user

This project was originally designed to run on Keil, but now you can also perform firmware flash on OpenOCD.

Note that if you want to use a 40MHz SPI acceleration, you need to specify the speed after the target device is connected, otherwise it will fail with the beginning.

# Run before approaching the flash command
> adapter speed 10000

> halt
> flash write_image [erase] [unlock] filename [offset] [type]

Keil's timing handling is somewhat different from OpenOCD's. For example, OpenOCD lacks the SWD line reset sequence before reading the IDCODE registers.

Uart TCP Bridge

TCP server on PORT 1234.

UART default baud: 74880

This feature provides a bridge between TCP and Uart:

Send data   ->  TCP  ->  Uart TX -> external devices

Recv data   <-  TCP  <-  Uart Rx <- external devices

uart_tcp_bridge

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

Credits to the following project, people and organizations:

License

Apache2.0 LICENSE