Skip to content

Commit fc1a16d

Browse files
committed
docs: Update doc
1 parent 6b81d9c commit fc1a16d

File tree

4 files changed

+179
-6
lines changed

4 files changed

+179
-6
lines changed

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: 154 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,159 @@
1-
# Attention
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
2149

3150
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.
4151

5152
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.
6153

7-
We will continue to try to make it work under USB HID. Once the USBIP problem is solved, we will immediately transfer it to work under WinUSB
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)

main/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ static void initialise_wifi(void)
103103
ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
104104
wifi_config_t wifi_config = {
105105
.sta = {
106-
.ssid = EXAMPLE_WIFI_SSID,
107-
.password = EXAMPLE_WIFI_PASS,
106+
.ssid = WIFI_SSID,
107+
.password = WIFI_PASS,
108108
},
109109
};
110110
os_printf("Setting WiFi configuration SSID %s...\r\n", wifi_config.sta.ssid);

main/wifi_configuration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
#ifndef __WIFI_CONFIGURATION__
1111
#define __WIFI_CONFIGURATION__
1212

13-
#define EXAMPLE_WIFI_SSID "DAP"
14-
#define EXAMPLE_WIFI_PASS "12345678"
13+
#define WIFI_SSID "DAP"
14+
#define WIFI_PASS "12345678"
1515

1616
#define PORT 3240
1717

0 commit comments

Comments
 (0)