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

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] 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
  • 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?
    wiki.segger.com/IMX7D

    Best regards,
    Nino
    Images
    • Capture.PNG

      42.33 kB, 677×762, viewed 849 times
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • 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?
  • Hello,

    I used the script int \Devices\NXP\iMX7D in J-Link software package folder.
    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.

    Keep in mind, this is *not* a support forum.
    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 you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.