Losing two days troubleshooting JTAG

May 14, 2025

Could not measure total IR len. TDO is constant high.

This error message haunted me.

I was trying to connect to the Cortex M of an IMX8MM-based SoM via its JTAG port, but I kept getting this error trace:

Connecting ...
 - Connecting via USB to probe/ programmer device 0
 - Probe/ Programmer firmware: J-Link V9 compiled May  7 2021 16:26:12
 - Probe/ Programmer S/N: REDACTED
 - Device "MIMX8MM6_M4" selected.
 - Target interface speed: 4000 kHz (Fixed)
 - VTarget = 3.322V
 - InitTarget() start
 - ***************************************************
 - J-Link script: iMX8M Mini Cortex-M4 J-Link script
 - ***************************************************
 - InitTarget() end - Took 14.1ms
 - Could not measure total IR len. TDO is constant high.
 - Failed to identify target. Resetting via Reset pin and trying again.
 - InitTarget() start
 - ***************************************************
 - J-Link script: iMX8M Mini Cortex-M4 J-Link script
 - ***************************************************
 - InitTarget() end - Took 14.0ms
 - Could not measure total IR len. TDO is constant high.
 - Executing init sequence ...
  - ERROR: Could not perform target reset
 - ERROR: Failed to connect.
Could not perform custom init sequence.
 - ERROR: Connect failed

Spot the difference

After days troubleshooting with the SoM vendor, comparing our setups, editing the J-Link script, someone on their staff was clever enough to compare the schematics of my JTAG adapter adapter (Olimex), vs theirs (Segger). Well, to compare them with more care than I did.

SeggerOlimex
segger olimex

Can you spot the difference ? R2 is an open circuit on the left, and a short circuit to GND on the right.

Solution

cut the trace between the pins of R2.

r2

The Olimex adapter comes with pin 9 grounded by default, whereas SEGGER ships an adapter with pin 9 floating. So just removing that short-circuit should make the Olimex adapter strictly equivalent to the Segger one.

Conclusion

I'll confess that spending that much time for such a simple problem, I was frustrated.

In the end, I can only blame myself for not reading schematics more carefully.

sigh

PS: I notified Olimex about this, and to my delight, they added an FAQ entry explaining the issue, right on the adapter product page. If that can spare someone else the trouble, it'll be worth it.


Profile picture

Written by Thibault Geoffroy.

I'm a maker, a developer and a musician.