Debugging an ARM core which is not 1st on JTAG chain

Technical Note 17681

Architectures:

Arm

Component:

debugger

Updated:

5/17/2022 8:08 AM

Introduction

This technical note provides information about how to debug a device that is not first in the JTAG chain.

Discussion

When the device is not first in the JTAG chain, C-SPY® needs information about the preceding devices. Use an I-jet® probe and the EmuDiag.exe tool to collect such information.

Example of a JTAG chain

A chain of connected JTAG devices is created by consecutively connecting TDO on one device to TDI on thenext device, and so on.

This schematic shows two devices connected in a JTAG chain.


Which device is the first device?

The first device (for this purpose), is the device where TDO is connected to the debug probe. Note that:

  • The first device will be given the ID TAP0 (zero).
  • When debugging the first device, there is no need to make extra settings.

Debugging a device that is not first in the JTAG chain

These steps are needed to debug a device that is not first in the JTAG chain. (In this example the JTAG chain consists of a Toshiba TMPM320-SK board and an ST STM32F207ZG board.)

  1. Connect the I-jet probe.
  2. Start Embedded Workbench for Arm®, and choose I-jet > EmuDiag.
  3. In EmuDiag.exe clikc the Test JTAG button. (This displays the JTAG Configuration dialog box.)
  4. Click the Autodetect button to see this JTAG chain:

  5. Note down this information:
    1. The ST STM32F207ZG has the ID TAP1
    2. The device at TAP0 (the Toshiba TMPM320) has IR=4. In other words, four preceding bits.
  6. Close EmuDiag.exe
  7. In Embedded Workbench for Arm, open the project for ST STM32F207ZG, and choose Project > Options > Debugger > I-jet > Interface

  8. Make these settings:
    1. Set Probe config to Explicit
    2. Multitarget debug system
    3. Set Target number to 1
    4. JTAG scan chain contains non-Arm devices
    5. Set Preceding bits to 4
  9. Click the Setup tab to select the Reset strategy:
    • For Cortex select Core reset.
    • For ARM 7/9 select Software reset.
    • It is important to choose a reset strategy that does not use TRST to reset, because such a reset will reset all cores.

More reading

For I-jet and EmuDiag.exe there is more information about the JTAG chain in the C:\Program Files\IAR Systems\Embedded Workbench 9.0\arm\bin\emudiag.pdf file. For J-Link, read the \arm\doc\JLink_J-TraceARM.pdf.

Conclusion

The I-jet probe can connect to any device in a JTAG chain. Connect the I-jet, use the EmuDiag.exe tool to collect information about the JTAG chain and enter that information in C-SPY Debugger Options dailog box.

All product names are trademarks or registered trademarks of their respective owners.

We do no longer support Internet Explorer. To get the best experience of iar.com, we recommend upgrading to a modern browser such as Chrome or Edge.