1 Star 2 Fork 2

黄大明 / wireless-esp8266-dap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

image

Build Status master  Build Status develop

 PRs Welcome %e2%9d%a4

Introduce

Wireless debugging with only one ESP8266 !

Realized by USBIP and CMSIS-DAP protocol stack.

👉 5m distance, 100kb size firmware(Hex) flash test:

Feature

  1. Debug Communication Mode & Debug Port

    • SWD(SW-DP)
    • JTAG(JTAG-DP)
    • SWJ-DP
  2. USB Communication Mode

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

    • UART Serial Wire Output(SWO)
    • SWO Streaming Trace
  4. More..

    • Custom maximum debug clock (40MHz, SWD only)
    • SWD protocol based on SPI acceleration
    • ...

Link your board

WIFI

The default connected WIFI SSID is DAP , password 12345678

You can change WIFI_SSID and WIFI_PASS in wifi_configuration.h

You can also specify your IP in the above file (We recommend using the static address binding feature of the router).

WIFI

Debugger

SWD
SWCLK GPIO14
SWDIO GPIO13
LED_CONNECTED GPIO2
LED_RUNNING GPIO15
TVCC 3V3
GND GND

JTAG
TCK GPIO14
TMS GPIO13
TDI GPIO4
TDO GPIO16
nTRST (optional) GPIO0*
nRESET GPIO5
LED_CONNECTED GPIO2
LED_RUNNING GPIO15
TVCC 3V3
GND GND

Here, we give a simple example for reference:

sch

Alternatively, you can connect directly with wires as we gave at the beginning, without additional circuits.

If you need to modify the LED or JTAG pins, please refer to the instructions in DAP_config.h to modify them carefully.


Build And Flash

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

Build with Github Action Online

See: Build with Github Action

General build and Flash

  1. Get ESP8266 RTOS Software Development Kit

    For now, use the 3.3-rc1 version of the SDK (this is a known issue) See: ESP8266_RTOS_SDK

  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 on Windows:

# Build
python ./idf.py build
# Flash
python ./idf.py -p /dev/ttyS5 flash

We also provided sample firmware quick evaluation. See Releases

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 esp8266 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-esp8266-ip-address>  1-1

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

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

image

Here, we use MDK for testing:

target


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.

Develop

  1. Check other branches to know the latest development progress.

  2. Use WinUSB Mode(enabled by default):

    change USE_WINUSB macor in dap_configuration.h

In this repo you can find the complete implementation of the USB protocol stack including USB-HID, WCID, WinUSB. Although WinUSB-based mode currently does not work on USBIP :disappointed_relieved: . They are very easy and can help you quickly build your own DAP on other hardware platforms.

Currently TCP transmission speed needs to be further improved, If you have any ideas, welcome:

Issue

2020.12.1

TCP transmission speed needs to be further improved.

2020.11.11

Winusb is now available, but it is very slow.

2020.2.4

Due to the limitation of USB-HID (I'm not sure if this is a problem with USBIP or Windows), now each URB packet can only reach 255 bytes (About 1MBps bandwidth), which has not reached the upper limit of ESP8266 transmission bandwidth.

I now have an idea to construct a Man-in-the-middle between the two to forward traffic, thereby increasing the bandwidth of each transmission.

2020.1.31

At present, the adaptation to WCID, WinUSB, etc. has all been completed. However, when transmitting data on the endpoint, we received an error message from USBIP. This is most likely a problem with the USBIP project itself.

Due to the completeness of the USBIP protocol document, we have not yet understood its role in the Bulk transmission process, which may also lead to errors in subsequent processes.

We will continue to try to make it work on USB HID. Once the USBIP problem is solved, we will immediately transfer it to work on WinUSB


Credit

Credits to the following project, people and organizations:

License

MIT LICENSE

MIT License Copyright (c) 2020 windowsair Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

ESP8266 Wireless Debugger. Based on CMSIS-DAP v2.0.0. Optional SPI acceleration, etc. ESP8266 无线调试器 展开 收起
C 等 4 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huang_daming/wireless-esp8266-dap.git
git@gitee.com:huang_daming/wireless-esp8266-dap.git
huang_daming
wireless-esp8266-dap
wireless-esp8266-dap
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891