Follow+Star Public Account, don’t miss out on exciting content
Author | strongerHuang
WeChat Public Account | Embedded Column
Embedded Column
1
In simple terms, a download debugger is a device that converts commands sent from a PC (for example, via USB protocol) into a language (such as SWD or JTAG protocol) that the MCU (which is responsible for the MCU’s internal peripherals) can understand, loading code and precisely controlling execution.
Embedded Column
2
2. The Chaos of Debugger Protocols
-
More time spent on learning
-
Increased costs for purchasing download debugging tools
-
Low efficiency in generating tests
To solve this issue, engineers from major MCU manufacturers and producers have established some standard protocols for debugging.
Embedded Column
3
JTAG: Joint Test Action Group, that is, the Joint Test Action Group.
This group began discussions in the late 1980s and officially released documentation interpreting the IEEE standard in 1990. (IEEE stands for the Institute of Electrical and Electronics Engineers, an international organization that publishes all standards, such as WiFi, Bluetooth, etc.). The protocol they proposed was documented in IEEE 1149.1 in 1990. The document has since been revised and improved, and as of this writing, the latest standard is IEEE 1149.7.
Embedded Column
4
SWD: Serial Wire Debug, is a protocol designed by ARM for programming and debugging its microcontrollers.
Since SWD is specifically designed for programming and debugging, it has many special features that are often not available elsewhere, such as sending debugging information to a computer via IO lines. Additionally, because it is specifically manufactured by ARM for use in its devices, SWD’s performance is typically the best among its peers!
Embedded Column
5
There are many MCUs and debugging adapters on the market that are compatible with both SWD and JTAG protocols. They typically implement download and debugging functions through a set of download debugging pins that are internally multiplexed to the SWD and JTAG peripherals.
1.Shared Pins
The SWD pins can be multiplexed with the JTAG pins under certain conditions. Currently, there are many connectors for JTAG and SWD, such as the 20-pin connector:
-
Uses fewer pins, requiring only SWDIO and SWCLK
-
SWD has special features, such as printing debugging information via its IO lines
-
SWD has better overall performance in speed compared to JTAG
-
JTAG is not limited to ARM chips; it also supports chips outside of ARM, such as the well-known MSP430
-
JTAG has more versatile applications for programming, debugging, and production testing
-
JTAG is an independent group that evolves with the development of the protocol
-
If your schematic/circuit board design is simple enough to be tested without JTAG functionality
-
Debugging performance is more important than production testing; your device focuses on serving research rather than mass production!
-
If the MCU has size limitations, SWD can save space
-
If your hardware design is too complex, and the MCU has no extra two pins
Embedded Column
6
The following summarizes with a diagram:
Reply in the background with ‘Download Programming Tools’ or ‘Communication Interface’ to read more related articles.
Click ‘Read Original’ to see more shares, and feel free to share, bookmark, like, and view.