Skip to content

Commit f45e017

Browse files
committed
Merge branch 'release/v0.1.0'
2 parents ba04bf3 + fc1a16d commit f45e017

40 files changed

+9006
-256
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.vscode/
2+
build/

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: c
2+
sudo: required
3+
before_install:
4+
- sudo apt install -y gcc git wget make libncurses-dev flex bison python python-serial
5+
- wget https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
6+
7+
install:
8+
- tar -xzf ./xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
9+
- git clone --recursive https://github.com/espressif/ESP8266_RTOS_SDK.git
10+
- python -m pip install --user -r ./ESP8266_RTOS_SDK/requirements.txt
11+
12+
before_script:
13+
- export IDF_PATH=$PWD/ESP8266_RTOS_SDK
14+
- export PATH="$PATH:$PWD/xtensa-lx106-elf/bin"
15+
16+
script:
17+
- python ./idf.py fullclean
18+
- python ./idf.py build
19+
20+
deploy:
21+
provider: releases
22+
api_key: ${GITHUB_TOKEN}
23+
file:
24+
- ./build/esp8266_dap.bin
25+
skip_cleanup: true
26+
on:
27+
tags: true

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# The following five lines of boilerplate have to be in your project's
22
# CMakeLists in this exact order for cmake to work correctly
33
cmake_minimum_required(VERSION 3.5)
4+
#set(COMPONENT_DIRS "${IDF_PATH}/components ${PROJECT_PATH}/components")
45

56
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6-
project(tcp_server)
7+
project(esp8266_dap)

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 windowsair
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<p align="center"><img src="https://user-images.githubusercontent.com/17078589/73821108-300bda00-482e-11ea-89f6-011a50037a12.png"/></p>
2+
<h1 align="center">Wireless ESP8266 DAP</h1>
3+
4+
[![Build Status](https://travis-ci.com/windowsair/wireless-esp8266-dap.svg?branch=master)](https://travis-ci.com/windowsair/wireless-esp8266-dap) master
5+
[![Build Status](https://travis-ci.com/windowsair/wireless-esp8266-dap.svg?branch=develop)](https://travis-ci.com/windowsair/wireless-esp8266-dap) develop
6+
7+
[![](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](https://github.com/windowsair/wireless-esp8266-dap/LICENSE) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-blue.svg?style=flat-square)](https://github.com/windowsair/wireless-esp8266-dap/pulls) [![%e2%9d%a4](https://img.shields.io/badge/made%20with-%e2%9d%a4-ff69b4.svg?style=flat-square)](https://github.com/windowsair/wireless-esp8266-dap)
8+
9+
10+
## Introduce
11+
12+
Wireless debugging with ***only one ESP8266*** !
13+
14+
Realized by USBIP and CMSIS-DAP protocol stack.
15+
16+
> 👉 5m distance, 100kb size firmware flash test:
17+
18+
<p align="center"><img src="https://user-images.githubusercontent.com/17078589/73829782-808b3380-483e-11ea-8389-1570bc4200af.gif"/></p>
19+
20+
## Feature
21+
22+
1. Debug Communication Mode
23+
- [x] SWJ
24+
- [x] JTAG
25+
26+
2. USB Communication Mode
27+
- [x] USB-HID
28+
- [ ] WCID & WinUSB
29+
30+
3. Debug Trace
31+
- [ ] UART Serial Wire Output(SWO)
32+
- [ ] SWO Streaming Trace
33+
34+
4. More..
35+
- [x] Custom maximum debug clock(more than 10MHz)
36+
- [ ] ...
37+
38+
39+
40+
## Link your board
41+
42+
1. WIFI
43+
44+
The default connected WIFI SSID is `DAP` , password `12345678`
45+
46+
You can change `WIFI_SSID` and ` WIFI_PASS` in [wifi_configuration.h](main/wifi_configuration.h)
47+
48+
2. Debugger
49+
50+
- SWD
51+
52+
| SWD | |
53+
|----------------|--------|
54+
| SWCLK | GPIO5 |
55+
| SWDIO | GPIO4 |
56+
| LED\_CONNECTED | GPIO2 |
57+
| LED\_RUNNING | GPIO15 |
58+
| TVCC | 3V3 |
59+
| GND | GND |
60+
61+
- JTAG
62+
63+
| JTAG | |
64+
|--------------------|---------|
65+
| TCK | GPIO5 |
66+
| TMS | GPIO4 |
67+
| TDI | GPIO13 |
68+
| TDO | GPIO12 |
69+
| nTRST \(optional\) | GPIO0\* |
70+
| nRESET | GPIO14 |
71+
| LED\_CONNECTED | GPIO2 |
72+
| LED\_RUNNING | GPIO15 |
73+
| TVCC | 3V3 |
74+
| GND | GND |
75+
76+
You can modify these pin definitions in [DAP_config.h](components/DAP/config/DAP_config.h)
77+
78+
> Tips: Try to avoid using `GPIO0`(working mode switch) and `GPIO16`(RTC)
79+
80+
## Build
81+
82+
1. Get ESP8266 RTOS Software Development Kit
83+
84+
See: [ESP8266_RTOS_SDK](https://github.com/espressif/ESP8266_RTOS_SDK "ESP8266_RTOS_SDK")
85+
86+
2. Build & Flash
87+
88+
Build with ESP-IDF build system.
89+
More information can be found at the following link: [Build System](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html "Build System")
90+
91+
The following example shows a possible way to build on Windows:
92+
93+
```bash
94+
# Build
95+
python ./idf.py build
96+
# Flash
97+
python ./idf.py -p /dev/ttyS5 flash
98+
```
99+
100+
> We also provided sample firmware quick evaluation. See [Releases](https://github.com/windowsair/wireless-esp8266-dap/releases)
101+
102+
103+
## Usage
104+
105+
1. Get USBIP project
106+
107+
- Windows: [usbip-windows](https://github.com/george-hopkins/usbip-windows "usbip-windows") . Or you can find it already built here: https://github.com/barbalion/usbip-win-client
108+
- Linux: Distributed as part of the kernel
109+
110+
2. Start esp8266 and connect it to the device to be debugged
111+
112+
3. Connect it with usbip:
113+
114+
```bash
115+
.\usbip.exe -D -a <your-esp8266-ip-address> 1-1
116+
```
117+
118+
If all goes well, you should see your device connected.
119+
![image](https://user-images.githubusercontent.com/17078589/73833411-eb3f6d80-4844-11ea-8501-02a008f6119d.png)
120+
121+
![target](https://user-images.githubusercontent.com/17078589/73830040-eb3c6f00-483e-11ea-85ee-c40b68a836b2.png)
122+
123+
124+
125+
## Develop
126+
127+
> Credits to:
128+
> - https://github.com/thevoidnn/esp8266-wifi-cmsis-dap for adapter firmware based on CMSIS-DAP v1.0
129+
> - https://github.com/ARM-software/CMSIS_5 for CMSIS
130+
131+
132+
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.
133+
134+
135+
Currently using USB-HID for transmission is still slightly slower, If you have any ideas, welcome:
136+
- [New issues](https://github.com/windowsair/wireless-esp8266-dap/issues)
137+
- [New pull](https://github.com/windowsair/wireless-esp8266-dap/pulls)
138+
139+
140+
### Issue
141+
142+
2-4
143+
144+
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.
145+
146+
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.
147+
148+
1-31
149+
150+
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.
151+
152+
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.
153+
154+
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
155+
156+
157+
158+
## License
159+
[MIT LICENSE](LICENSE)

components/DAP/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(COMPONENT_ADD_INCLUDEDIRS "config include $ENV{IDF_PATH}/components/esp8266/include/esp8266/ $ENV{IDF_PATH}//components/esp_ringbuf/include/")
2+
set(COMPONENT_SRCS "./source/DAP.c ./source/DAP_vendor.c ./source/JTAG_DP.c ./source/SW_DP.c ./source/SWO.c ./source/uart_modify.c")
3+
4+
5+
register_component()

0 commit comments

Comments
 (0)