To debug ARM , you must follow the ARM debug interface protocol, and JTAG is one of them. When simulating, IAR, KEIL, ADS, etc. all have a common debug interface, and RDI is one of them. So how do we complete the conversion from RDI to ARM debug protocol (JTAG)? There are two ways:
1. Write a service program on the computer to parse the RDI commands in IAR, KEIL and ADS into the relevant JTAG protocol, and then send it to your target board through a physical conversion interface (note that this conversion is only a conversion on the electrical physical layer, just like the function of RS232). H-JTAG is like this. The hardware of H-JTAG is just a physical level conversion interface, so it is very simple. The h-JTAG software installed in the computer is the service program mentioned above, which is responsible for protocol conversion.
2. Make a board to directly receive debugging commands from IAR, KEIL, ADS and other software, and use this board to convert RDI->JTAG protocol. Then communicate with the target board, which is the working principle of JLINK.
From the above, we can see that H-JTAG is slower because it uses software to convert protocols, but the hardware is simple. The second method, JLINK, generally has a powerful CPU to convert hardware protocols, which makes the hardware complex but fast.
Basic Principles of JTAG
JTAG (Joint Test Action Group) is an international standard test protocol (IEEE1149.1 compatible). The standard JTAG interface is 4 lines - TMS, TCK, TDI, TDO, which are mode selection, clock, data input and data output lines respectively.
There are two main functions of JTAG, or there are two main categories of JTAG:
1) One type is used to test the electrical characteristics of the chip to detect whether there is a problem with the chip;
2) Another type is used for debugging, debugging various chips and their peripheral devices; a CPU with a JTAG Debug interface module can access the CPU's internal registers, devices hanging on the CPU bus, and registers of built-in modules through the JTAG interface as long as the clock is normal. This article mainly introduces the Debug function.
JTAG Principle Analysis
Simply put, the working principle of JTAG can be summarized as: define a TAP (Test Access Port) inside the device, and use a dedicated JTAG test tool to test and debug the internal nodes. First, the basic concepts and contents of boundary scan and TAP are introduced.
Boundary Scan
The basic idea of boundary scan technology is to add a shift register unit, namely boundary scan register, close to the input/output pins of the chip.
When the chip is in the debugging state, the boundary scan register can isolate the chip from the peripheral input/output. Through the boundary scan register unit, the chip input/output signals can be observed and controlled. For the input pin of the chip, the signal (data) can be loaded into the pin through the boundary scan register unit connected to it; for the output pin of the chip, the output signal on the pin can also be "captured" through the boundary scan register connected to it. Under normal operating conditions, the boundary scan register is transparent to the chip, so normal operation will not be affected in any way. In this way, the boundary scan register provides a convenient way to observe and control the chip that needs to be debugged. In addition, the boundary scan (shift) register units on the chip input/output pins can be connected to each other to form a boundary scan chain (Boundary-ScanChain) around the chip. The boundary scan chain can be serially input and output, and the chip in the debugging state can be easily observed and controlled through the corresponding clock signal and control signal.
Test access port TAP
TAP (Test Access Port) is a general port. Through TAP, all data registers (DR) and instruction registers (IR) provided by the chip can be accessed. The control of the entire TAP is completed by the TAP controller (TAPController). The following will introduce several interface signals of TAP and their functions. Among them, the first four signals are mandatory in the IEEE1149.1 standard.
TCK: Clock signal, provides an independent, basic clock signal for TAP operation.
TMS: Mode selection signal, used to control the transition of the TAP state machine.
TDI: data input signal.
TDO: data output signal.
TRST: Reset signal, which can be used to reset (initialize) the TAPController. This signal interface is not mandatory in the IEEE1149.1 standard, because the TAPController can also be reset through TMS.
STCK: Clock return signal, not mandatory in the IEEE1149.1 standard.
Simply put, PC debugging of the target board is to access the relevant data register (DR) and instruction register (IR) through the TAP interface.
After the system is powered on, TAPController first enters the Test-LogicReset state, then enters the Run-Test/Idle, Selcct-DR- Scan, Select-IR-Scan, Capture-IR, Shift-IR, Exitl-IR, Update-IR states in sequence, and finally returns to the Run-Tcst/Idle state. In this process, the state transfer is driven by the TCK signal (rising edge), and the TAP state is selected and converted by the TMS signal. Among them, in the Capture-IR state, a specific logic sequence is loaded into the instruction register; in the Shift-IR state, a specific instruction can be sent to the instruction register; in the Update-IR state, the instruction just entered into the instruction register will be used to update the instruction register. Finally, the system returns to the Run-Test/Idle state, the instruction takes effect, and the access to the instruction register is completed. When the system returns to the Run-Test/Idle state, the required data register is selected according to the content of the previous instruction register, and the work on the data register begins. The basic principle is exactly the same as the access to the instruction register, which is sequentially select-DR-Scan, Capture-DR, Shift-D, Exit-DR, Update-DR, and finally returns to the Run-Tcst/Idle state. Through TD1 and TDO, new data can be loaded into the data register. After one cycle, the data in the data register can be captured, and the data update of the chip pins connected to each register unit of the data register is completed, and the access to the data register is also completed.
At present, there are two types of JTAG interfaces on the market: 14-pin and 20-pin. Among them, 20-pin is the mainstream standard, but there are also a few target boards that use 14-pin. After a simple signal conversion, they can be used interchangeably.
Previous article:Design of intelligent caller display based on chip ZLG7289A
Next article:Embedded PLC System Design Based on LPC2294 Processor
- Popular Resources
- Popular amplifiers
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- [Help] I'm trying to build a NAS for my own use with a Raspberry Pi. Can anyone tell me if it's useful?
- Today at 10:00 AM Award-winning live broadcast: nanoPower technology: Extending battery life and improving sensor performance
- A pit of STM32 standard USB library (V2.2.1)
- CodeBug Hands-on Learning 1 - Unboxing
- Please help me solve the problem of converting gerber files to PCB files
- HP laptop battery is swollen, where can I get a new one?
- pyRTOS(1): Introduction
- CircuitPython 5.0.0 Beta 5 released
- Problem with conditional execution with $value$plusargs
- An Engineer's Guide to EMI - Specification and Measurement