All Projects → windowsair → wireless-esp8266-dap

windowsair / wireless-esp8266-dap

Licence: MIT license
ESP8266 Wireless Debugger. Based on CMSIS-DAP v2.0.0. Optional 40MHz SPI acceleration, etc. ESP8266 无线调试器

Programming Languages

c
50402 projects - #5 most used programming language
python
139335 projects - #7 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to wireless-esp8266-dap

Esp At
AT application for ESP32 ESP-IDF & ESP32S2 ESP-IDF & ESP8266 ESP8266_RTOS_SDK
Stars: ✭ 319 (+107.14%)
Mutual labels:  esp8266, esp32, wifi
Esp32marauder
A suite of WiFi/Bluetooth offensive and defensive tools for the ESP32
Stars: ✭ 233 (+51.3%)
Mutual labels:  esp8266, esp32, wifi
Esp3d
FW for ESP8266/ESP8285/ESP32 used with 3D printer
Stars: ✭ 979 (+535.71%)
Mutual labels:  esp8266, esp32, wifi
esp8266-wifi-cmsis-dap
WIRELESS CMSIS-DAP USB/IP-SWD/JTAG HID adapter firmware for ESP8266 boards
Stars: ✭ 69 (-55.19%)
Mutual labels:  esp8266, wifi, cmsis-dap
Esp wifimanager
This is an ESP32 / ESP8266 WiFi Connection Manager with fallback web configuration portal. Use this library for configuring ESP32, ESP8266 modules' WiFi, etc. Credentials at runtime. You can also specify static DNS servers, personalized HostName, fixed or random AP WiFi channel. With examples supporting ArduinoJson 6.0.0+ as well as 5.13.5- .
Stars: ✭ 125 (-18.83%)
Mutual labels:  esp8266, esp32, wifi
Blynk Library
Blynk library for embedded hardware. Works with Arduino, ESP8266, Raspberry Pi, Intel Edison/Galileo, LinkIt ONE, Particle Core/Photon, Energia, ARM mbed, etc.
Stars: ✭ 3,305 (+2046.1%)
Mutual labels:  esp8266, esp32, wifi
Bleeper
Library to manage your firmware configurations written in C++
Stars: ✭ 54 (-64.94%)
Mutual labels:  esp8266, esp32, wifi
Atc
STM32 LL AT-Command parser
Stars: ✭ 53 (-65.58%)
Mutual labels:  esp8266, esp32, wifi
Perswifimanager
Persistent WiFiManager Arduino library for ESP8266
Stars: ✭ 106 (-31.17%)
Mutual labels:  esp8266, esp32, wifi
Wled Wemos Shield
Wemos D1 Mini (ESP8266) or Wemos ESP32 D1 Mini (ESP32) based shield for WLED firmware
Stars: ✭ 105 (-31.82%)
Mutual labels:  esp8266, esp32, wifi
issues
Issue Tracker for ESPHome
Stars: ✭ 182 (+18.18%)
Mutual labels:  esp8266, esp32, wifi
Feature Requests
ESPHome Feature Request Tracker
Stars: ✭ 160 (+3.9%)
Mutual labels:  esp8266, esp32, wifi
LibTeleinfo
Librairie Universelle Teleinformation (TIC)
Stars: ✭ 77 (-50%)
Mutual labels:  esp8266, esp32, wifi
Esphelper
A library to make using WiFi & MQTT on the ESP8266 easy.
Stars: ✭ 310 (+101.3%)
Mutual labels:  esp8266, esp32, wifi
low-power-wifi
Experiments in low-power-wifi on esp8266, esp32, and ...
Stars: ✭ 35 (-77.27%)
Mutual labels:  esp8266, esp32, wifi
Blinker Library
An IoT Solution,Blinker library for embedded hardware. Works with Arduino, ESP8266, ESP32.
Stars: ✭ 1,095 (+611.04%)
Mutual labels:  esp8266, esp32, wifi
Blinker Doc
blinker中文文档
Stars: ✭ 139 (-9.74%)
Mutual labels:  esp8266, esp32, wifi
Espmqttclient
Wifi and MQTT handling for ESP8266 and ESP32
Stars: ✭ 169 (+9.74%)
Mutual labels:  esp8266, esp32, wifi
ESP32 Thing
Development platform for the Espressif ESP32 WiFi/Microcontroller SoC
Stars: ✭ 66 (-57.14%)
Mutual labels:  esp32, wifi
ESP32 IMU BARO GPS VARIO
GPS altimeter/variometer with LCD display, routes with waypoints, data/gps track logging, bluetooth NMEA sentence transmission, wifi AP + webpage configuration
Stars: ✭ 72 (-53.25%)
Mutual labels:  wifi, esp-idf

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 range, 100kb size firmware(Hex) earse and download 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)

    • Uart TCP Bridge
  4. More..

    • SWD protocol based on SPI acceleration
    • ...

Link your board

WIFI

The default connected WIFI SSID is DAP or OTA , password 12345678

Support for specifying multiple possible WAP. It can be added here: 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

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

mDNS

Debugger

SWD
SWCLK GPIO14
SWDIO GPIO13
TVCC 3V3
GND GND

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

Other
LED_WIFI_STATUS GPIO15
Tx GPIO2
Rx GPIO3 (U0RXD)

Rx and Tx is used for uart bridge, not enabled by default.


Hardware Reference

Here we provide a simple example for reference:

sch

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

In addition, a complete hardware reference design is available from contributors, see circuit


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

    The SDK is already included in the project, please use it for subsequent operations.

  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


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
  • ...

For ESP8266, this is not far from UDP FLOOD...😰

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.

System OTA

When this project is updated, you can update the firmware over the air.

Visit the following website for OTA operations: online OTA

For most ESP8266 devices, you don't need to care about flash size. However, improper setting of the flash size may cause the OTA to fail. In this case, please change the flash size with idf.py menuconfig, or modify sdkconfig:

# Choose a flash size.
CONFIG_ESPTOOLPY_FLASHSIZE_1MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y

# Then set a flash size
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"

If flash size is 2MB, the sdkconfig file might look like this:

CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"

For devices with 1MB flash size such as ESP8285, the following changes must be made:

CONFIG_PARTITION_TABLE_FILENAME="partitions_two_ota.1MB.csv"
CONFIG_ESPTOOLPY_FLASHSIZE_1MB=y
CONFIG_ESPTOOLPY_FLASHSIZE="1MB"
CONFIG_ESP8266_BOOT_COPY_APP=y

The flash size of the board can be checked with the esptool.py tool:

esptool.py -p (PORT) flash_id

Uart TCP Bridge

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 time. 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.

For performance reasons, this feature is not enabled by default. You can modify wifi_configuration.h to turn it on.


Develop

Check other branches to know the latest development progress.

Any kind of contribute is welcome, including but not limited to new features, ideas about circuits, documentation.

You can also ask questions to make this project better.

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].