Need help accessing the 2nd TAP in the Jtag daisy chain

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

  • Need help accessing the 2nd TAP in the Jtag daisy chain

    Hi,

    I'm trying to access the 2nd Jtag in the daisy chain using the JLink Commander.
    Here's the start up log which showed 2 JTAG devices:
    ==========================================================
    SEGGER J-Link Commander V5.10o (Compiled Feb 25 2016 18:51:37)
    DLL version V5.10o, compiled Feb 25 2016 18:50:59

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-STM32F103 V1 compiled Feb 5 2014 13:48:52
    Hardware version: V1.00
    S/N: 660006136
    Emulator has Trace capability
    VTref = 3.300V
    Type "connect" to establish a target connection, '?' for help
    J-Link>
    Unknown command. '?' for help.
    J-Link>connect
    Please specify device / core. <Default>: CORTEX-M0
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>
    Device "CORTEX-M0" selected.
    TotalIRLen = 9, IRPrint = 0x0021
    Found Cortex-M0 r0p0, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl 0 @ E00FF000
    ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
    Found 2 JTAG devices, Total IRLen = 9:
    #0 Id: 0x040037E3, IRLen: 05, Unknown device
    #1 Id: 0x0BA01477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)[/b]

    Cortex-M0 identified.
    ==========================================================
    When I check the IDCODE it shows ID from #1 device:
    J-Link>i
    JTAG Id: 0x0BA01477 Version: 0x0 Part no: 0xba01 Man. Id: 023B

    I'm new to this, could anyone please give me some pointers on how to access device#0 to do some basic tag operations like
    IDCODE, access some registers... I could not find any sample code for this on Segger or the internet.

    Much appreciate.
  • Hi,

    J-Link Commander asks you to enter the JTag chain position of the device you want the J-Link to connect to.
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>


    Best regards,
    Niklas
    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 Niklas,

    Thanks for your advice. So base on our set up which showed the 2 Jtag ID below:
    ...
    Found 2 JTAG devices, Total IRLen = 9:
    #0 Id: 0x040037E3, IRLen: 05, Unknown device
    #1 Id: 0x0BA01477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
    Cortex-M0 identified.
    ...

    So my IRPre=4 and DRPre=1 thus I entered JTAGConf > 4,1 as below but encountered an error:
    ======================
    SEGGER J-Link Commander V5.10o (Compiled Feb 25 2016 18:51:37)
    DLL version V5.10o, compiled Feb 25 2016 18:50:59

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-STM32F103 V1 compiled Feb 5 2014 13:48:52
    Hardware version: V1.00
    S/N: 660006136
    Emulator has Trace capability
    VTref = 3.300V

    Type "connect" to establish a target connection, '?' for help
    J-Link>connect
    Please specify device / core. <Default>: CORTEX-M0
    Type '?' for selection dialog
    Device>
    Please specify target interface:
    J) JTAG (Default)
    S) SWD
    TIF>
    Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
    JTAGConf>4,1
    Specify target interface speed [kHz]. <Default>: 4000 kHz
    Speed>1000
    Device "CORTEX-M0" selected.

    TotalIRLen = 9, IRPrint = 0x0021

    ****** Error: Bad JTAG communication: Write to IR: Expected 0x1, got 0x2 (TAP Command : 10) @ Off 0x9.

    Can not connect to target.
    ======================

    Am I still missing something ?

    Thanks.
  • Hi,

    in order to speed things up:
    Can you provide me with a link to the Board that you are using? (The Board with the JLink OB)

    Best regards,
    Niklas
    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 Dien,


    sorry for the delay in response.
    I did not mean to ask for further information regarding the J-Link OB,
    instead I wanted to know the name of the board the J-Link OB is soldered on.

    Sorry for any confusion caused.


    Best regards,
    Niklas
    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.
  • SEGGER - Niklas wrote:

    Hi Dien,


    sorry for the delay in response.
    I did not mean to ask for further information regarding the J-Link OB,
    instead I wanted to know the name of the board the J-Link OB is soldered on.

    Sorry for any confusion caused.


    Best regards,
    Niklas


    Hi Niklas,

    Thanks for your reply. We purchased and soldered the JLink-OB part (from Segger) into our in-house design board (Vorago REB1).
    I can send you some info on the board if you want, just give me your email address.

    Also, do you have some sample code accessing the 2nd Jtag tap that I could use for reference ?

    Thanks,
    Dien
  • Hi Dien,


    could you please get in contact with segger.com/support/technical-support/ ?
    Questions regarding development of J-Link OB boards should be discussed via E-Mail.
    I can send you some info on the board if you want, just give me your email address.

    Could you please attach them to the first mail you send to segger.com/support/technical-support/ ?

    Best regards,
    Niklas
    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 Dien,


    in order to access this device in the JTAG-chain, you need to
    • Invoke J-Link Commander with the command line parameter -JTAGConf <IRPre>,<DRPre>
    • Do not set a device or type "connect"
    • Instead, you can now instantly use the following JTAG Commands:

    Source Code

    1. wjc Write JTAG command (IR). Syntax: wjc <Data>(hex)
    2. wjd Write JTAG data (DR). Syntax: wjd <Data64>(hex), <NumBits>(dec)
    3. wjraw Write Raw JTAG data. Syntax: wjraw <NumBits(dec)>, <tms>, <tdi>


    Best regards,
    Niklas
    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.
  • SEGGER - Niklas wrote:

    Hi Dien,


    in order to access this device in the JTAG-chain, you need to
    • Invoke J-Link Commander with the command line parameter -JTAGConf <IRPre>,<DRPre>
    • Do not set a device or type "connect"
    • Instead, you can know instantly use the following JTAG Commands:

    Source Code

    1. wjc Write JTAG command (IR). Syntax: wjc <Data>(hex)
    2. wjd Write JTAG data (DR). Syntax: wjd <Data64>(hex), <NumBits>(dec)
    3. wjraw Write Raw JTAG data. Syntax: wjraw <NumBits(dec)>, <tms>, <tdi>


    Best regards,
    Niklas


    Hi Niklas,

    I tried your advice and it no longer show the JTAG communication error (showed in previous msg). But still not showing the expect IDCODE data for the 2nd TAP:

    ===================
    C:\Program Files (x86)\SEGGER\JLink_V510r>JLink.exe -JTAGConf 4,1
    SEGGER J-Link Commander V5.10r (Compiled Mar 8 2016 17:35:19)
    DLL version V5.10r, compiled Mar 8 2016 17:34:46

    Connecting to J-Link via USB...O.K.
    Firmware: J-Link OB-STM32F103 V1 compiled Feb 5 2014 13:48:52
    Hardware version: V1.00
    S/N: 660006136
    Emulator has Trace capability
    VTref = 3.300V

    Type "connect" to establish a target connection, '?' for help
    J-Link>wjc 0x6 ===> this is 2nd TAP (Jtag chip) idcode instruction
    TotalIRLen = 9, IRPrint = 0x0021
    Command 0x6 (Unknown JTAG instruction) successfully written
    J-Link>wjd 0,36 - Expected this return value be 0x040037E3 but got 0 instead !!!
    returns 0x0
    J-Link>wjc 0xe ===> this is 1st TAP (ARM chip) idcode instruction
    Command 0xE (IDCODE) successfully written
    J-Link>wjd 0,36
    returns 0xBA01477
    ================
    Thanks,
    Dien
  • Hi Dien and Forum,

    J-Link Commander is not designed for performing low-level actions on non-supported cores / targets.
    There are some low-level JTAG commands available but they are mainly designed to be used on known/supported cores.
    The commands are listed in post #9 of this thread .

    In order to perform fully customized operations on very low level JTAG, there are basically two options:
    1) Use the J-Link API directly to output low-level JTAG sequences. This can be done via the J-Link SDK (Part No 8.08.06 on the price list).
    2) Use JTAGLoad that comes with the J-Link software & documentation pack:




    Best regards,
    Niklas
    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 Niklas,

    Thanks for your advice. I'd downloaded the latest JTAGLoad s/w version JLink_V510u and tried, was able to read out both IDCODEs for the 2 Jtag TAPS.
    Saw some commands listed in the SVFdocument so here's some of my findings when running JTAGLoad with the .svf file:

    1. C:\Program Files (x86)\SEGGER\JLink_V510u>JTAGLoad.exe c:\users\dhoang\READMEM.svf.txt
    SEGGER JTAG Load V5.10u
    Compiled Mar 17 2016 18:57:36

    Executing file [c:\users\dhoang\READMEM.svf.txt]...

    WARNING:
    Command "TRST" is not supported in this software version !

    2. STATE : only these states are accepted: IDLE, RESET but others (DESELECT, DRSHIFT,....) are not:
    ERROR:
    "DRCAPTURE" is not a stable JTAG state !
    Error in file [c:\users\dhoang\READMEM.svf.txt], line 24, column 17:
    "STATE DRCAPTURE;"

    Could you please shine some light ? What do I need to do to get these to work ?

    Thanks,
    Dien