dqLuEpNdu

High-speed wireless DAP debugger

 
Overview

This project is prohibited from commercial use without authorization.
Update log
#2023.04.16
Fixes the problem that the CDC may be stuck when sending data to the serial port when the computer serial port is not opened;
fixes some lighting effect problems;
Note: When downloading DAP, it is best not to open and Closing the serial port may cause the download to fail, but data transmission through the open serial port will not be affected.
#2023.04.01
First release
1. Introduction
When debugging a microcontroller program, if the debugging target moves or is dangerous, since mistakes are inevitable during the debugging process, we all hope to stay away from it and protect our computers. In the past, a common solution was to connect a long USB cable, but it was too troublesome, and the distance was only a few meters; later, wireless debuggers appeared, which can solve this problem to a great extent. However, the wireless debuggers currently on the market are mixed, and it is easy to buy debuggers that are extremely slow and have extremely unstable connections (I have been through many pitfalls), and the relatively easy-to-use wireless debuggers I know are very expensive (say The one I bought is the punctual atomic model, if you want to buy the finished product, you can choose it), the price of 300+ is unacceptable. Therefore, through multiple iterations, I finally got a suitable solution for a DIY wireless debugger. Using the CH32V307RCT6 microcontroller and the SX1281 wireless module, at a total cost of less than 100 yuan, I can get a wireless debugger with performance comparable to the Punctual Atom 300+.
A wireless debugger is divided into a sending end (Host) and a receiving end (Slave). The software and hardware of both ends are completely the same. You can perform pairing, mode switching, parameter adjustment and other operations through buttons or the host computer. Like regular DAP, it supports debugging ARM microcontrollers (such as STM32, GD32, etc.) (the CH32V307 used in the debugger is a RiscV microcontroller, which is used to debug ARM microcontrollers. Is it also NTR in a sense), and supports SWD and JTAG. , supports hardware reset and software reset, and also has a virtual serial port available. After pairing, you can plug and play without installing drivers (WIN10 and above). In addition to wireless mode, you can also switch to wired mode (USB) to facilitate temporary use in places with complex wireless environments. The performance will be better than wireless mode.
The colors of different indicator lights represent different modes, red represents wired mode (USB), blue represents the wireless transmitter (Host), and green represents the wireless receiver (Slave). Under normal connection status, the indicator light is a breathing light; if the other end of the wireless device is not ready (not powered on or not paired), the indicator light flashes slowly. When downloading and debugging is being performed or there is data in the virtual serial port, the indicator light will flash quickly.
2. Finished product display
3. Production process
1. PCB production: Make PCB according to open source files. It is recommended to choose 1.0 board thickness. There are three PCB files in total, one of which is the main board (Main) and the other two are the shell. You can choose the logo of the Up board by yourself, and the shell designed by RMer can even be used for visual debugging (funny).
2. PCB welding: Basically, the components used can be purchased at Lichuang, or you can go to Aobao to find cheaper ones. The attached BOM contains two reference purchase links for Lichuang and Taobao. After the soldering is completed, it is as shown in the picture (ignoring the crystal oscillator. I drew the wrong board in the early stage, so I turned it 90 degrees and soldered it).
3. Firmware download: After confirming that the PCBA is produced correctly, download the debugger firmware. Install and open the WCHISPTool in the attachment, press and hold button A, and connect the debugger to the computer with a USB cable. At this time, WCHISPTool automatically recognizes the chip CH32V307. Select the firmware DAP_V04.hex, configure it according to the instructions in the figure below, and download it. If you want to use the wireless module without soldering and only use it as a wired module, select DAP_V04_USB_ONLY.hex. If it is an old version of hardware, select the corresponding version number.
4. Pairing and parameter setting: Unplug the USB cable, press and hold button B, and reconnect the USB to the computer. At this time, the indicator light is yellow. Check the corresponding COM port in the device manager, open the host computer software, and perform pairing settings according to the instructions in the figure below. If you need to re-pair later, follow the same steps.
Except for the subscript parameters, it is not recommended to modify other parameters!
Be sure to modify the default communication frequency and synchronization word to prevent collision with other people's DAP!
 
5. Test: Test whether downloading, virtual serial port and other functions are normal.
6. Shell installation: For the screws and copper posts used, see the attached BOM. Weld the SMT nuts to the bottom plate (Down), use a single copper post to fix the motherboard to the bottom plate, and use m2 screws to install the top plate (Up).
4. Daily use
1. Keil settings
If you are unable to connect or the connection is unstable, you can try to reduce the clock frequency and replace the connected DuPont cable. In addition, some types of chips may not be able to be debugged normally at high clock frequencies (such as the HK32F030MF4P6 I have used).
2. The button function
can set the DAP mode without the need for a host computer. Press and hold button A until the indicator light turns yellow. Short press button B to adjust to the desired mode according to the color of the indicator light. If you need to save the configuration to Flash, that is, keep the current configuration the next time you power on, press and hold button A until the indicator light turns yellow and flash, then short press button A to exit; if it is only for temporary use, do not save the configuration to Flash. Then directly press button A to exit.
3. Interference
If you encounter serious signal interference in the current frequency band, you can try to change the communication frequency. Too strong interference will lead to reduced speed, unstable downloads, etc.
4. Communication distance
The communication distance of this set of debuggers is still relatively long (tens of meters is still no problem). If there is really a need for farther, you can install external antennas, reduce the air rate, etc., but this is not the case. Not recommended.
5. Performance test
environment: Keil MDK 5.21
Target chip: STM32F412RGT6
Firmware size: about 1024K
Test method: Mobile phone stopwatch timing, average three times.
Since the Erase and Verify downloaders take about the same time during the download process, the calculation can reflect the downloader download. As can be seen from the program duration and speed of
this project, the wired mode speed of the debugger of this project is slightly higher than Jlink V9, and the wireless mode speed is slightly lower than STLink V2, but the difference is very small. I have also tested some wireless debuggers from Moubao, and many of them have speeds of more than ten KB/s, but this is normal, because the speed of the ordinary version of wired DAP is only 20+KB/s.
 
Interested brothers can join the QQ group: 770979540 to communicate and discuss
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-19 18:37:44

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号