Debugging Jtag

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Debugging (An Introduction)

Debugging:

In order to download your program code to the microcontroller, and to carry out debug
operations like halting and single stepping, you might need a debug adaptor.

It is used to convert a USB connection from your PC to a debug communication protocol used
by the microcontrollers.

JTAG debug protocol SWD (SERIAL WIRE


DEBUG PROTOCOL)

The debug communication protocol is then converted again by hardware on-chip, so that various
debug components and debug features can be accessed.

We can read and access (Live) any changes happening in the processor core registers,
processor peripherals, Microcontroller peripherals, any variable, or any function.

Different terminologies for debug adaptors:

debug probe USB-JTAG adaptor JTAG/SW Emulator

JTAG In-Circuit Emulator


(ICE),

ENG. MOEMEN MOHAMED


The Debug adaptor can be:

External On board (on the development board itself)

e.g. ulink debug adaptor. Onboard ICDI available on tm4c launchpad

The Tiva C Series Launchpad evaluation board comes with an on-board In-Circuit Debug
Interface (ICDI).
The ICDI allows for the programming and debugging of the TM4C123GH6PM using the LM
Flash Programmer and/or any of the supported tool chains.
Note that the ICDI supports only JTAG debugging. An external debug interface can be
connected for Serial Wire Debug (SWD) and SWO (trace) (printf style debugging). JTAG
Protocol uses 4 pins from the microcontroller:

ENG. MOEMEN MOHAMED


SWD JTAG
Protocol Protocol

Debugging TM4C123GH6PM mcu using code composer studio:


Once there is a communication connection between the debug host and the microcontroller, we
can then:

• Download a compiled program image to the microcontroller.


• Control the microcontroller to perform a reset.
• Start the program execution, or if you like, execute instructions line by line (single
stepping).
• Insert/remove breakpoints: the breakpoint feature allows you to define instruction
addresses so that when the processor gets to that instruction, it stops there (enters halt, or
sometimes referred to as debug state in ARM documentation)
• You can examine or change the contents of the memory or peripherals at any time,
even when the processor is running. This feature is often called on-the-fly memory
access.

Step into Step over Step return


restart

• We can use step into in a debugging session to get into a c function and execute it line by
line.
• We can use step return in a debugging session to get out of a c function.
• We can use step over in a debugging session to execute the next instruction.

ENG. MOEMEN MOHAMED

You might also like