[SOLVED] Cannot select the correct Kinetis target in a JTAG chain

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

  • [SOLVED] Cannot select the correct Kinetis target in a JTAG chain

    Hi!

    I have a taunting issue using a J-Link and J-Flash, regarding targeting a specific device in a chain.

    While using the IDE (EWARM 7.80.4) there are no issues, the IDE can correctly select TAP 0 or 1.

    However, for production loading, either via J-link or J-Flash, only TAP 0 (the same as auto detection selects) gets selected.

    I've tried all kinds of remedies and tips from this forum and others with no real success.

    Using J-Flash:
    All devices are correctly detected, however, selecting device 1 and flashing, results in device 0 getting flashed.
    J-flash log:
    J-Link firmware: J-Link ARM-Pro V1.x compiled Dec 3 2013 14:20:30
    Device "MK66FN2M0XXX18" selected.
    InitTarget()
    TotalIRLen = 8, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    TotalIRLen = 8, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x001C0000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    ROMTbl[0][6]: E0042000, CID: B105900D, PID: 003BB907 ETB
    ROMTbl[0][7]: E0043000, CID: B105900D, PID: 001BB908 CSTF

    See jflash_tap1 for the j-flash device configuration.

    J-link:
    I've also tried to target a specific device with the jtagconf command, and had no success there either.
    jlink -if jtag -jtagconf 4,1 -autoconnect 0 -device MK66FN2M0XXX18 -speed auto
    SEGGER J-Link Commander V6.46g (Compiled Jun 14 2019 19:34:42)
    DLL version V6.46g, compiled Jun 14 2019 19:33:33

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link ARM-Pro V1.x compiled Dec 3 2013 14:20:30
    Hardware version: V1.10
    S/N: 171100199
    License(s): RDI, FlashBP, FlashDL, JFlash, GDB
    IP-Addr: DHCP (no addr. received yet)
    VTref=3.332V


    Type "connect" to establish a target connection, '?' for help
    J-Link>h
    Target connection not established yet but required for command.
    Device "MK66FN2M0XXX18" selected.


    Connecting to target via JTAG
    InitTarget()
    TotalIRLen = 8, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    TotalIRLen = 8, IRPrint = 0x0011
    JTAG chain detection found 2 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    Scanning AP map to find all available APs
    AP[2]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x24770011)
    AP[1]: JTAG-AP (IDR: 0x001C0000)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410FC241. Implementer code: 0x41 (ARM)
    Found Cortex-M4 r0p1, Little endian.
    FPUnit: 6 code (BP) slots and 2 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 003BB002 DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 003BB001 ITM
    ROMTbl[0][4]: E0040000, CID: B105900D, PID: 000BB9A1 TPIU
    ROMTbl[0][5]: E0041000, CID: B105900D, PID: 000BB925 ETM
    ROMTbl[0][6]: E0042000, CID: B105900D, PID: 003BB907 ETB
    ROMTbl[0][7]: E0043000, CID: B105900D, PID: 001BB908 CSTF
    Cortex-M4 identified.
    PC = 00007420, CycleCnt = E9AA7ACB
    R0 = 20011960, R1 = 0000000F, R2 = 20011960, R3 = 00000000
    R4 = 00000007, R5 = 2000BFE4, R6 = 00000000, R7 = 07070707
    R8 = 08080808, R9 = 09090909, R10= 10101010, R11= 11111111
    R12= 12121212
    SP(R13)= 20013098, MSP= 20013098, PSP= 20004A28, R14(LR) = 000077A5
    XPSR = 0100000F: APSR = nzcvq, EPSR = 01000000, IPSR = 00F (INTISR0)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00

    FPS0 = 00000138, FPS1 = 48960000, FPS2 = 00000000, FPS3 = 00000000
    FPS4 = 00000000, FPS5 = 00000000, FPS6 = 00000000, FPS7 = 00000000
    FPS8 = 00000000, FPS9 = 00000000, FPS10= 00000000, FPS11= 00000000
    FPS12= 00000000, FPS13= 00000000, FPS14= 00000000, FPS15= 00000000
    FPS16= 00000000, FPS17= 00000000, FPS18= 00000000, FPS19= 00000000
    FPS20= 00000000, FPS21= 00000000, FPS22= 00000000, FPS23= 00000000
    FPS24= 00000000, FPS25= 00000000, FPS26= 00000000, FPS27= 00000000
    FPS28= 00000000, FPS29= 00000000, FPS30= 00000000, FPS31= 00000000
    FPSCR= 02000010
    J-Link>

    This also connects to TAP 0 instead of 1.

    I've also tried all kinds of different jtagconf parameters, all of them connect to TAP 0 ?(

    Both of my MCUs have a status LED, in each case the LED of MCU 0 stops flashing.


    Any ideas?
    Images
    • jflash_tap1.png

      19.24 kB, 476×500, viewed 651 times
  • Hello,

    Thank you for your inquiry.
    Such an issue is not known to us.
    Which J-Link software version are you using?
    Could you give the latest version a try?
    segger.com/downloads/jlink/#J-…twareAndDocumentationPack

    The J-Link you are using is out of support for 7 years now and out of maintenance for more than 6.
    We recommend upgrading that device to a newer version.
    For this we offer a trade in program:
    segger.com/purchase/trade-in-program/


    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.
  • Issue resolved.
    It would seem the combination of J-Link software and the J-Link adapter was the issue all along.
    I rolled back the J-Link software to version 5.10m and everything JTAG works just as expected.

    A side note: We had an issue with a much newer J-Link Base that simply could not use JTAG at all with software version 6.xx, only SWD was functional. A rollback to v5.10m resolved this issue as well.