Monday, May 21st 2018, 7:26am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 120

1

Thursday, May 10th 2018, 6:21am

J-Link: Bad JTAG communication: Write to IR ... error

I'm on JLink V632b, target iMX7D, on M4 core.

On some cases when trying to connect with JLink the device gets totally hardlocked, seems followed by SoC reset, with halt of main core, and total deadlock / not able to connect to target anymore with JLink.

I see this trace:
J-Link: Bad JTAG communication: Write to IR: Expected 0x1, got 0xF (TAP Command : 10) @ Off 0x5.
Could not find core in Coresight setup


After this I have to full reset the board. Any help on this ?


JLink trace log :

J-Link: Device "MCIMX7D7_M4" selected.
J-Link: *************************************************
J-Link: J-Link script: iMX7D Cortex-M4 core J-Link script
J-Link: *************************************************
J-Link: TotalIRLen = 4, IRPrint = 0x01
J-Link: JTAG chain detection found 1 devices:
J-Link: #0 Id: 0x5BA00477, IRLen: 04, CoreSight JTAG-DP
J-Link: AP map detection skipped. Manually configured AP map found.
J-Link: AP[0]: AHB-AP (IDR: Not set)
J-Link: AP[1]: APB-AP (IDR: Not set)
J-Link: AP[2]: CUSTOM-AP (IDR: Not set)
J-Link: AP[3]: CUSTOM-AP (IDR: Not set)
J-Link: AP[4]: AHB-AP (IDR: Not set)
J-Link: AP[4]: Skipped. Could not read AHB ROM register
J-Link: AP map detection skipped. Manually configured AP map found.
J-Link: AP[0]: AHB-AP (IDR: Not set)
J-Link: AP[1]: APB-AP (IDR: Not set)
J-Link: AP[2]: CUSTOM-AP (IDR: Not set)
J-Link: AP[3]: CUSTOM-AP (IDR: Not set)
J-Link: AP[4]: AHB-AP (IDR: Not set)
J-Link: AP[4]: Skipped. No ROM table (AHB-AP ROM base: 0x00000000)
J-Link: *************************************************
J-Link: J-Link script: iMX7D Cortex-M4 core J-Link script
J-Link: *************************************************
J-Link: *************************************************
J-Link: J-Link script: iMX7D Cortex-M4 core J-Link script
J-Link: *************************************************
J-Link: Bad JTAG communication: Write to IR: Expected 0x1, got 0xF (TAP Command : 10) @ Off 0x5.
Could not find core in Coresight setup

J-Link: *************************************************
J-Link: J-Link script: iMX7D Cortex-M4 core J-Link script
J-Link: *************************************************
J-Link: *************************************************
J-Link: J-Link script: iMX7D Cortex-M4 core J-Link script
J-Link: *************************************************
Connection failed

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Monday, May 14th 2018, 2:39pm

Hello,

Thank you for your inquiry.
Such an issue is not known to us.
We tried to reproduce the issue with a MCIMX7SABRE board but everything was working as expected.
What is suspicious is that according to your log the JLinkScript gets called 4 times which indicates that the initial connect is already not working.

A successful connect sequence is attached. There the script gets called only once.
When setting up your iMX7D application did you consider the recommendations from our Wiki?
https://wiki.segger.com/IMX7D

Best regards,
Nino
SEGGER - Nino has attached the following image:
  • Capture.PNG
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


v01d

Beginner

Date of registration: Feb 29th 2016

Posts: 120

3

Monday, May 14th 2018, 4:33pm

Hi,

Note that I noted that in _some_ cases you get this issue. So I wouldn't expect you to hit every time the problem.

I also noted that , from your screenshot, you don't seem to be using Segger provided JLink connect script ? - NXP_iMX7D_Connect_CortexM4.JLinkScript.
I see you select the device in the command shell.

In my connect I use the script - NXP_iMX7D_Connect_CortexM4.JLinkScript. I don't specify -device as you do, I just put Cortex-M4. ( as the script handles device connection anyway .. ? )

My connect string looks like :

JLinkExe -device Cortex-M4 -autoconnect 1 -if JTAG -speed 4000 -JTAGConf -1,-1 -JLinkScriptFile << path to script >>

And similarly for JLinkGDBServer .

Does it matter here if you use proper MCIMX... M4 device name, or Cortex-M4, if you using the connect script?

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

4

Wednesday, May 16th 2018, 5:29pm

Hello,

I used the script int \Devices\NXP\iMX7D in J-Link software package folder.

Quoted

Does it matter here if you use proper MCIMX... M4 device name, or Cortex-M4, if you using the connect script?

It does especially for iMX device series.
We generally recommend selecting the exact device name so all J-Link features get enabled
Selecting generic Coretypes might work for rudimentary debug support but anything more complex and it might not work properly.

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/