Skip to content

Commit 87a6a1d

Browse files
committed
Merge branch 'release/v0.1.1-alpha'
2 parents f45e017 + bed6adc commit 87a6a1d

File tree

9 files changed

+159
-80
lines changed

9 files changed

+159
-80
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
language: c
22
sudo: required
33
before_install:
4-
- sudo apt install -y gcc git wget make libncurses-dev flex bison python python-serial
4+
- sudo apt update
5+
- sudo apt install -y gcc git wget make libncurses-dev flex bison python python-serial ninja-build
56
- wget https://dl.espressif.com/dl/xtensa-lx106-elf-linux64-1.22.0-100-ge567ec7-5.2.0.tar.gz
67

78
install:
89
- 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+
- wget https://github.com/espressif/ESP8266_RTOS_SDK/releases/download/v3.3-rc1/ESP8266_RTOS_SDK-v3.3-rc1.zip
11+
- unzip ESP8266_RTOS_SDK-v3.3-rc1.zip
1012
- python -m pip install --user -r ./ESP8266_RTOS_SDK/requirements.txt
1113

1214
before_script:

README.md

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,35 @@ Realized by USBIP and CMSIS-DAP protocol stack.
2020
## Feature
2121

2222
1. Debug Communication Mode
23-
- [x] SWJ
23+
- [x] SWD
2424
- [x] JTAG
2525

2626
2. USB Communication Mode
27-
- [x] USB-HID
28-
- [ ] WCID & WinUSB
27+
- [x] USB-HID (Default)
28+
- [x] WCID & WinUSB (Experimental)
2929

3030
3. Debug Trace
3131
- [ ] UART Serial Wire Output(SWO)
3232
- [ ] SWO Streaming Trace
3333

3434
4. More..
35-
- [x] Custom maximum debug clock(more than 10MHz)
35+
- [x] Custom maximum debug clock ~~(more than 10MHz)~~ (experimental)
3636
- [ ] ...
3737

3838

3939

4040
## Link your board
4141

42-
1. WIFI
42+
### WIFI
4343

4444
The default connected WIFI SSID is `DAP` , password `12345678`
4545

4646
You can change `WIFI_SSID` and ` WIFI_PASS` in [wifi_configuration.h](main/wifi_configuration.h)
4747

48-
2. Debugger
48+
### Debugger
49+
50+
4951

50-
- SWD
5152

5253
| SWD | |
5354
|----------------|--------|
@@ -58,7 +59,9 @@ You can change `WIFI_SSID` and ` WIFI_PASS` in [wifi_configuration.h](main/wifi_
5859
| TVCC | 3V3 |
5960
| GND | GND |
6061

61-
- JTAG
62+
63+
--------------
64+
6265

6366
| JTAG | |
6467
|--------------------|---------|
@@ -81,12 +84,13 @@ You can modify these pin definitions in [DAP_config.h](components/DAP/config/DAP
8184

8285
1. Get ESP8266 RTOS Software Development Kit
8386

84-
See: [ESP8266_RTOS_SDK](https://github.com/espressif/ESP8266_RTOS_SDK "ESP8266_RTOS_SDK")
87+
For now, use the 3.3-rc1 version of the SDK (this is a known issue)
88+
See: [ESP8266_RTOS_SDK](https://github.com/espressif/ESP8266_RTOS_SDK/releases/tag/v3.3-rc1 "ESP8266_RTOS_SDK")
8589

8690
2. Build & Flash
8791

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")
92+
Build with ESP-IDF build system.
93+
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")
9094

9195
The following example shows a possible way to build on Windows:
9296

@@ -104,29 +108,49 @@ python ./idf.py -p /dev/ttyS5 flash
104108

105109
1. Get USBIP project
106110

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
111+
- Windows: [usbip-win](https://github.com/cezanne/usbip-win) .
112+
> The pre-compiled version on SourceForge is also available, for HID mode only, but it may be faster.
108113
- Linux: Distributed as part of the kernel
109114

110115
2. Start esp8266 and connect it to the device to be debugged
111116

112117
3. Connect it with usbip:
113118

114119
```bash
120+
# HID Mode
121+
# for pre-compiled version on SourceForge
122+
# or usbip old version
115123
.\usbip.exe -D -a <your-esp8266-ip-address> 1-1
124+
125+
# HID Mode Or WinUSB Mode
126+
# for usbip-win 0.3.0 kmdf ude
127+
.\usbip.exe attach-ude -r <your-esp8266-ip-address> -b 1-1
128+
116129
```
117130

118131
If all goes well, you should see your device connected.
132+
119133
![image](https://user-images.githubusercontent.com/17078589/73833411-eb3f6d80-4844-11ea-8501-02a008f6119d.png)
120134

135+
136+
Then test it under MDK:
137+
121138
![target](https://user-images.githubusercontent.com/17078589/73830040-eb3c6f00-483e-11ea-85ee-c40b68a836b2.png)
122139

123140

124141

125142
## Develop
126143

144+
1. Use WinUSB Mode:
145+
146+
change `USE_WINUSB` macor in [USBd_config.h](components/USBIP/USBd_config.h)
147+
148+
149+
127150
> Credits to:
128151
> - https://github.com/thevoidnn/esp8266-wifi-cmsis-dap for adapter firmware based on CMSIS-DAP v1.0
129152
> - https://github.com/ARM-software/CMSIS_5 for CMSIS
153+
> - https://github.com/cezanne/usbip-win for usbip windows
130154
131155

132156
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.
@@ -139,13 +163,18 @@ Currently using USB-HID for transmission is still slightly slower, If you have a
139163

140164
### Issue
141165

142-
2-4
166+
2020.11.11
167+
168+
Winusb is now available, but it is very slow.
169+
170+
171+
2020.2.4
143172

144173
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.
145174

146175
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.
147176

148-
1-31
177+
2020.1.31
149178

150179
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.
151180

components/USBIP/MSOS20Descriptors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const uint8_t bosDescriptor[kLengthOfBos] =
6161
0x05, // bLength of this descriptor
6262
USB_DESCRIPTOR_TYPE_BOS, // BOS Descriptor type(Constant)
6363
USBShort(kLengthOfBos), // wLength
64-
0x01, // bNumDeviceCaps
64+
0x01, // bNumDeviceCaps -> only 0x01 for OS2.0 descriptor
6565

6666
// Microsoft OS 2.0 platform capability descriptor header (Table 4)
6767
// See also:

components/USBIP/USB_handle.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,9 @@
1919
#include "usb_defs.h"
2020
#include "MSOS20Descriptors.h"
2121

22-
// const char *strings_list[] = {
23-
// 0, // reserved: available languages
24-
// "windowsair",
25-
// "CMSIS-DAP v2",
26-
// "1234",
27-
// };
2822

2923
const char *strings_list[] = {
30-
0, // reserved: available languages
24+
0, // reserved: available languages -> iInterface
3125
"windowsair",
3226
"esp8266 CMSIS-DAP",
3327
"1234",
@@ -241,8 +235,7 @@ static void handleGetDescriptor(usbip_stage2_header *header)
241235
else
242236
{
243237
os_printf("Sending ALL CONFIG\r\n");
244-
245-
send_stage2_submit(header, 0, header->u.cmd_submit.data_length);
238+
send_stage2_submit(header, 0, sizeof(kUSBd0ConfigDescriptor) + sizeof(kUSBd0InterfaceDescriptor));
246239
send(kSock, kUSBd0ConfigDescriptor, sizeof(kUSBd0ConfigDescriptor), 0);
247240
send(kSock, kUSBd0InterfaceDescriptor, sizeof(kUSBd0InterfaceDescriptor), 0);
248241
}
@@ -315,16 +308,19 @@ static void handleGetDescriptor(usbip_stage2_header *header)
315308
////TODO:UNIMPLEMENTED
316309
send_stage2_submit(header, 0, 0);
317310
break;
318-
311+
#if (USE_WINUSB == 1)
319312
case USB_DT_BOS:
320313
os_printf("* GET 0x0F BOS DESCRIPTOR\r\n");
321314
send_stage2_submit_data(header, 0, bosDescriptor, sizeof(bosDescriptor));
322315
break;
316+
#else
323317
case USB_DT_HID_REPORT:
324318
os_printf("* GET 0x22 HID REPORT DESCRIPTOR\r\n");
325319
send_stage2_submit_data(header, 0, (void *)kHidReportDescriptor, sizeof(kHidReportDescriptor));
326320
break;
321+
#endif
327322
default:
323+
//// TODO: ms os 1.0 descriptor
328324
os_printf("USB unknown Get Descriptor requested:%d\r\n", header->u.cmd_submit.request.wValue.u8lo);
329325
os_printf("low bit :%d\r\n",header->u.cmd_submit.request.wValue.u8lo);
330326
os_printf("high bit :%d\r\n",header->u.cmd_submit.request.wValue.u8hi);

components/USBIP/USBd_config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ const uint8_t kUSBd0DeviceDescriptor[0x12] =
2626
{
2727
0x12, // bLength
2828
USB_DT_DEVICE, // bDescriptorType
29+
30+
#if (USE_WINUSB == 1)
2931
USBShort(0x0210), // bcdUSB
32+
#else
33+
USBShort(0x0200), // bcdUSB
34+
#endif
3035
////TODO: Is it also available elsewhere?
3136

3237
// We need to use a device other than the USB-IF standard, set to 0x00

0 commit comments

Comments
 (0)