Jlink edu support for TI AM572x evaluation module

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

  • Jlink edu support for TI AM572x evaluation module

    Hello,

    I have TI AM572x evaluation module (ti.com/tool/TMDSEVM572X). I would like to use Jlink edu with it. My questions are

    1) Is it supported? According to the supported devices and CPU cores link (segger.com/jlink_supported_devices.html#SupportedCPUCores), AM5728 processor is not listed. AM5728 is a dual core ARM cortex A15. But according to the supported devices and CPU link Cortex A15 seems to be supported. So, I am not sure if it is supported or to what extent.

    Unrelated question about JTAG:

    1) I am new to JTAG debugging and just started playing with hardware for the same. I always thought JTAG is an open standard. Then, why is it that the debuggers only support a certain set devices and CPUs? If the standard is open then shouldn't they support all of them. Could you please let me know why it is so.

    Thank you very much for your time.
  • Hi,


    yes, JTAG is an open standard.
    J-Link will output any JTAG sequence you give it to any target which is JTAG-complaint.
    However, this is not what most customers (and, I guess, also you) need / want.
    Most customers need high level functions, like reading / writing from / to at a certain memory location, setting a breakpoint, step etc, or do not even want to use those, but are using an IDE and the IDE's UI and do not care how the memory window, BPs, and other debugging features work, but just want to use them.

    Your findings regarding support is correct. Cortex-A15 is supported, the Ti AM572x is not supported.
    Since the core is supported, all core depended features are available, e.g.:
    • Reading memory mapped memory
    • Writing directly writable memory (e.g. RAM)
    • Setting hardware breakpoints / watchpoints
    • (Single-) Stepping
    • ...

    When a device is not listed as supported, this means the following:
    • The device has not been tested with J-Link
    • Internal flash memory programming for this device is not supported (debugging in flash may still be possible)
    • No device specific behavior is implemented/handled in the J-Link software
    • ->Some devices have quirks like resetting not only the device but also the debug logic on reset, some devices need a special sequence before a JTAG debug probe can connect, etc.
    • ->In most cases, the user can still use J-Link with a device with those issues by using J-Link script files

    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.
  • Thank you very much Niklas for the reply.

    1) From the link below and I quote "If a device is not listed here, it still has a fair chance to work. However, in case of doubt, feel free to get in touch with SEGGER." Also, from your reply below I quote "When a device is not listed as supported, this means the following: The device has not been tested with J-Link"

    segger.com/ti-code-composer-studio.html#AddJLinkSupport

    So, how do I go about checking if the device works or not. Both from TI code composer studio and from segger's own command line tools. I am using linux at my end.

    2) If I determine that the device is not supported and I would like to explore the CPU (Cortex A15) support, how would I go about it. Bacause, I could not find Cortex-A15 in the "new target configuration", advanced settings. As can be seen in the attached picture.

    3) Even with JlinkEXE on Linux.. It does not seem to connect to the target.

    Source Code

    1. XXX@XXX ~ % JLinkExe
    2. SEGGER J-Link Commander V6.14d (Compiled Apr 19 2017 18:28:26)
    3. DLL version V6.14d, compiled Apr 19 2017 18:28:18
    4. Connecting to J-Link via USB...O.K.
    5. Firmware: J-Link V9 compiled Apr 7 2017 09:16:10
    6. Hardware version: V9.30
    7. S/N: xxxxxx
    8. License(s): FlashBP, GDB
    9. OEM: SEGGER-EDU
    10. VTref = 3.333V
    11. Type "connect" to establish a target connection, '?' for help
    12. J-Link>connect
    13. Please specify device / core. : CORTEX-A15
    14. Type '?' for selection dialog
    15. Device>
    16. Please specify target interface:
    17. J) JTAG (Default)
    18. S) SWD
    19. TIF>J
    20. Device position in JTAG chain (IRPre,DRPre) : -1,-1 => Auto-detect
    21. JTAGConf>
    22. ERROR while parsing value for IRPre. Using default: -1.
    23. ERROR while parsing value for DRPre. Using default: -1.
    24. Specify target interface speed [kHz]. : 4000 kHz
    25. Speed>
    26. Device "CORTEX-A15" selected.
    27. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    28. TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
    29. Cannot connect to target.
    Display All


    I guess, in here CORTEX-15 is connected. But not the target right??
    Images
    • Screenshot_20170428_114039.png

      93.46 kB, 1,876×1,079, viewed 520 times

    The post was edited 4 times, last by solidrepellent ().

  • Hi,

    3) Even with JlinkEXE on Linux.. It does not seem to connect to the target.


    Lets focus on this first.
    What does the documentation say about the position of the devices in the JTAG chain? Are they in a JTAG chain at all?
    What is connected to the debug connector on the board?
    Which cores are enabled after a power-on reset?

    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.
  • Hello Niklas,


    >>>What does the documentation say about the position of the devices in the JTAG chain? Are they in a JTAG chain at all?

    I have gone through the technical reference manual of the board (AM572x EVM). But unfortunately, could not find any information about the position of devices in the JTAG scan chain. Am, I looking at the right place? Or do I need to look elsewhere?

    TI sells its own debuggers and supports this board. So, I assume the devices are in the scan chain so that it can detect it.

    >>>What is connected to the debug connector on the board?

    There is the following adapter I am using to connect Segger JLink. I bought it a week or so ago.

    mouser.fr/ProductDetail/Segger…ECqZFij3iF56lu1erKQ%3d%3d


    >>>Which cores are enabled after a power-on reset?

    I am sorry I could not find the answer to this too. I assume this information would also be in the same place as the JTAG scan chain information. ??

    The post was edited 1 time, last by solidrepellent ().

  • Hi,

    this usually documented in the reference manual of the CPU:
    ti.com/product/AM5728/technicaldocuments
    "AM572x Sitara Processor Technical Reference Manual (Rev. H)"
    ti.com/lit/pdf/spruhz6

    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.
  • Thanks Niklas.


    It looks like the the first level of debug interface seen by the debugger is the ICEPick module embedded in the debug subsystem. The MPU subsystem is on TAP number 15 (page 7871, TRM of AM5728).

    So, I am guessing that the debugger should first negotiate with the ICEPick module and then only I can see the MPU subsystem. And now, it is unable to do so. Am I right?

    So, what should be my next steps? is there a way to negotiate with the ICEPick using JLinkEXE?



  • Hi,

    is there a way to negotiate with the ICEPick using JLinkEXE?

    Yes.

    You will need to "implement" a connect-sequence for the TI AM5728 in a J-Link script file.
    How to use J-Link script files and which functions etc are available is documented in the J-Link Manual (UM08001)

    In order to get started, I would suggest to take a look at the script file for the TI CC3200, which is shipped with the J-Link software. (C:\Program Files (x86)\SEGGER\JLink_V6xxx\Devices\TI\TI_CC3200.JLinkScript).

    The first important thing to notice is that InitTarget() is executed instead of the default connect sequence.

    C Source Code

    1. /*********************************************************************
    2. *
    3. * InitTarget()
    4. *
    5. * Function description
    6. * If present, called right before performing generic connect sequence.
    7. * Usually used for targets which need a special connect sequence.
    8. * E.g.: TI devices with ICEPick TAP on them where core TAP needs to be enabled via specific ICEPick sequences first
    9. *
    10. * Return value
    11. * >= 0: O.K.
    12. * < 0: Error
    13. *
    14. * Notes
    15. * (1) Must not use high-level API functions like JLINK_MEM_ etc.
    16. * (2) For target interface JTAG, this device has to setup the JTAG chain + JTAG TAP Ids.
    17. */
    18. void InitTarget(void) {
    19. int r;
    20. //
    21. // The TI CC3200 supports JTAG only because the ICEPick on it only supports JTAG
    22. //
    23. r = -1;
    24. if (JLINK_ActiveTIF == JLINK_TIF_JTAG) {
    25. r = _InitICEPick();
    26. }
    27. //
    28. // Set other global variables needed by the DLL
    29. //
    30. JLINK_CPU = CORTEX_M4; // For a complete list of known CPU constants, please refer to UM08001 (J-Link User Guide)
    31. JLINK_CORESIGHT_AddAP(0, CORESIGHT_AHB_AP); // AHB-AP to System Bus
    32. JLINK_CORESIGHT_IndexAHBAPToUse = 0; // Cortex-M: AP-Index of AHB-AP to use for communication with core. Cortex-A/R: AP-Index of AHB-AP that can be used for SEGGER RTT
    33. JLINK_JTAG_AllowTAPReset = 0; // J-Link must not use TAP reset (avoid TAP state machine going reset state) as this would reset the ICEPick and kick the Cortex-M4 core out of the JTAG chain
    34. if (r < 0) {
    35. Report("ERROR: Cannot connect to target device");
    36. }
    37. }
    Display All


    InitTarget() calls (among other things) the local function _InitICEPick():

    C Source Code

    1. /*********************************************************************
    2. *
    3. * _InitICEPick
    4. */
    5. int _InitICEPick(void) {
    6. [..]
    7. //
    8. // ICEPick does not seem to like high JTAG speeds during the init...
    9. // so reduce the JTAG speed
    10. //
    11. Result = 0;
    12. Speed = JTAG_Speed;
    13. JTAG_Speed = 100;
    14. //
    15. // Perform a TAP reset to make sure that only the ICEPick is in the JTAG chain
    16. //
    17. JTAG_Write(0x1F, 0, 6);
    18. //
    19. // Basic configuration of the JTAG chain to enable use of high-level JTAG API
    20. // JTAG Device #0 is the TAP closest to TDO
    21. // JTAG chain: TDI -> ICEPick (IR6) -> -> TDO
    22. //
    23. JTAG_DRPre = 0;
    24. JTAG_DRPost = 0;
    25. JTAG_IRPre = 0;
    26. JTAG_IRPost = 0;
    27. JTAG_IRLen = 6;
    28. JTAG_StoreIR(_ICEPICK_IR_IDCODE);
    29. BitPos = JTAG_StoreDR(0x00000000, 32);
    30. ICEPickId = JTAG_GetU32(BitPos);
    31. Report1("ICEPick IDCODE: ", ICEPickId);
    32. //
    33. // Put the CPU core TAP (SDTR0) in the JTAG chain
    34. //
    35. _ICEPick_AddTAP(_ICEPICK_SDTR0);
    36. //
    37. // Re-configure JTAG chain as DAP is now in the chain, too
    38. // JTAG Device #0 is the TAP closest to TDO
    39. // JTAG chain: TDI -> ICEPick (IR6) -> CoreSight-DAP (IR4) -> TDO
    40. //
    41. JTAG_DRPre = 0;
    42. JTAG_DRPost = 1;
    43. JTAG_IRPre = 0;
    44. JTAG_IRPost = 6;
    45. JTAG_IRLen = 4;
    46. //
    47. // Get Id of DAP
    48. //
    49. JTAG_StoreIR(_DAP_IR_IDCODE);
    50. BitPos = JTAG_StoreDR(0x00000000, 32);
    51. DAPId = JTAG_GetU32(BitPos);
    52. if ((DAPId & 0x00000FFF) != 0x00000477) {
    53. Report1("Cannot read DAP IDCODE. Expected 0xXXXXX477, read: ", DAPId);
    54. Result = -1;
    55. }
    56. //
    57. // Set TAP-Ids of devices in the JTAG chain
    58. //
    59. JLINK_JTAG_SetDeviceId(0, DAPId);
    60. JLINK_JTAG_SetDeviceId(1, ICEPickId);
    61. //
    62. // Restore JTAG speed settings
    63. //
    64. JTAG_Speed = Speed;
    65. return Result;
    66. }
    Display All


    You need to adjust to script to your use case according to the reference manual, as this script is for the CC3200, but most likely you can keep the general structure.

    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.
  • Thanks Niklas. I will implement the script and get back.

    But, how do I test it? I am on Linux. Would the following command work?

    JLinkEXE -device Cortex-A15 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1 -JLinkScriptFile “./Default.JLinkScript“
  • Hi,


    sure, J-Link script files are also supported an Linux.
    The example scripte file for the TI CC3200 should be located in /opt/SEGGER/xxx/Devices/TI/TI_CC3200.JLinkScript .

    I do not know why you would place your script file in root (/) and call it Default.JLinkScript, but it should work, as long as JLinkExe is allowed to read this path.

    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.
  • I do not know why you would place your script file in root (/) and call it Default.JLinkScript, but it should work, as long as JLinkExe is allowed to read this path.
    You missed the "." in front of that slash (/). :)

    May be I should give it a proper name like "TI_AM5728.JLinkScript".

    Thanks again.
  • Hi,

    You missed the "." in front of that slash (/). :)


    I did, thanks for pointing that out :)

    The easiest way to test if the relative path works is to put a
    Report("Hello J-Link script file! ");
    or the like as first instruction in InitTarget().

    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,

    "MAIN_ActiveTIF" is the deprecated form of "JLINK_ActiveTIF". Both do the same.
    We will update the manual accordingly.


    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.
  • Thank you.

    Where do I get ICEPICK related setup constants for the script? I am looking into the following document which is listed in the technical manual. But it does not seem to have all the information.

    processors.wiki.ti.com/images/…an_Sequence-ICEpick-D.pdf

    Also, for
    JTAG_Write()
    Description: Writes a JTAG sequence (max. 64 bits per pin).
    Prototype: __api__ int JTAG_Write(unsigned __int64 tms, unsigned __int64 tdi, int NumBits);
    are tms and tdi the addresses?
  • Hi,

    Where do I get ICEPICK related setup constants for the script? I am looking into the following document which is listed in the technical manual. But it does not seem to have all the information.

    processors.wiki.ti.com/images/f/f…e-ICEpick-D.pdf


    Comparing the section Adding a single TAP to the Scan Chain and the _ICEPick_AddTAP() function of the provided TI_CC3200.JLinkScript, I would say they are doing the same thing.
    What information is missing?
    The TAP number is 15, as described in SPRUHZ6H Chapter 34.3.3 Dynamic TAP Insertion -> 34.3.3.1 ICEPick Secondary TAPs .

    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.
  • Hello Niklas,

    I meant some of the constants below. Where can I confirm these?


    _ICEPICK_IR_BYPASS = 0x3F;
    _ICEPICK_IR_ROUTER = 0x02;
    _ICEPICK_IR_IDCODE = 0x04;
    _ICEPICK_IR_ICEPICKCODE = 0x05;
    _ICEPICK_IR_CONNECT = 0x07;
    _ICEPICK_IR_USERCODE = 0x08;
    _ICEPICK_CONNECT_WRITE_KEY = 0x89;
    _ICEPICK_ROUTER_READ_REG = 0;
    _ICEPICK_ROUTER_WRITE_REG = 1;
    _ICEPICK_BLOCKSEL_ICEPICK_LOGIC = 0;

    When I try to check the register names in Code composer studio with a non-existent TI debugger, I get different names. As can be seen in the attachment. Since, the names seem to be different in CCS, TI documentation and the JLINK documentation I am unable to compare the two and get those constant values and other parameters.

    Also, in the following bit of code, how do I get the device ID of the target? I mean this 0xXXXXX477 part.

    C Source Code

    1. if ((DAPId & 0x00000FFF) != 0x00000477) {
    2. Report1("Cannot read DAP IDCODE. Expected 0xXXXXX477, read: ", DAPId);
    3. Result = -1;
    4. }

    Images
    • Screenshot_20170512_150812.png

      278.05 kB, 1,872×1,077, viewed 449 times
  • Hi,


    all of these values are listed in the TI manual you linked in the section "Adding a single TAP to the Scan Chain": processors.wiki.ti.com/images/…an_Sequence-ICEpick-D.pdf

    Example:
    (Sry, no syntax highlighting, does not work together with color highlighting...)
    Manual:

    Values: Red

    Step 1: Green
    ## Function : Do a send-only JTAG IR/DR scan.
    Parameter : The route to JTAG shift state is 'shortest transition'.
    Parameter : The JTAG shift state is 'shift-ir'.
    Parameter : The JTAG destination state is 'pause-ir'.
    Parameter : The bit length of the command is '6'.
    Parameter : The send data value is '0x00000007'.
    Parameter : The actual receive data is 'discarded'.

    Step 2: Brown
    ## Function : Do a send-only JTAG IR/DR scan.
    Parameter : The route to JTAG shift state is 'shortest transition'.
    Parameter : The JTAG shift state is 'shift-dr'.
    Parameter : The JTAG destination state is 'pause-dr'.
    Parameter : The bit length of the command is '8'.
    Parameter : The send data value is '0x00000089'.
    Parameter : The actual receive data is 'discarded'.

    Script file:
    /*********************************************************************
    *
    * _ICEPick_AddTAP
    */
    void _ICEPick_AddTAP(int SDTRReg) {
    int v;
    int TAPRegVal;
    int _ICEPICK_IR_BYPASS;
    int _ICEPICK_IR_ROUTER;
    int _ICEPICK_IR_IDCODE;
    int _ICEPICK_IR_ICEPICKCODE;
    int _ICEPICK_IR_CONNECT;
    int _ICEPICK_IR_USERCODE;
    int _ICEPICK_CONNECT_WRITE_KEY;
    int _ICEPICK_ROUTER_READ_REG;
    int _ICEPICK_ROUTER_WRITE_REG;
    int _ICEPICK_BLOCKSEL_ICEPICK_LOGIC;
    int _ICEPICK_BLOCKSEL_STTR;
    int _ICEPICK_BLOCKSEL_SDTR;
    //
    // Setup constants
    //
    _ICEPICK_IR_BYPASS = 0x3F;
    _ICEPICK_IR_ROUTER = 0x02;
    _ICEPICK_IR_IDCODE = 0x04;
    _ICEPICK_IR_ICEPICKCODE = 0x05;
    _ICEPICK_IR_CONNECT = 0x07;
    _ICEPICK_IR_USERCODE = 0x08;
    _ICEPICK_CONNECT_WRITE_KEY = 0x89;
    _ICEPICK_ROUTER_READ_REG = 0;
    _ICEPICK_ROUTER_WRITE_REG = 1;
    _ICEPICK_BLOCKSEL_ICEPICK_LOGIC = 0;
    _ICEPICK_BLOCKSEL_STTR = 1;
    _ICEPICK_BLOCKSEL_SDTR = 2;
    //
    // Add TAP to ICEPick
    //
    JTAG_StoreIR(_ICEPICK_IR_CONNECT);
    v = _ICEPICK_CONNECT_WRITE_KEY;
    JTAG_StoreDR(v, 8); // Put ICEPick module into connected state
    [...]


    Since, the names seem to be different in CCS, TI documentation and the JLINK documentation


    In the J-Link script file, these names are local variables.
    The names do not matter. Only the JTAG sequence does matter.


    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,

    Also, in the following bit of code, how do I get the device ID of the target?

    According to the Ti manual, Chapter 1.5 AM572x Device Identification;
    Table 1-5 AM572x ID_CODE Values:

    Brainfuck Source Code

    1. | Silicon Type | ID_CODE |
    2. |---------------+------------|
    3. | AM572x SR1.0 | 0x0B99002F |
    4. | AM572x SR1.1 | 0x1B99002F |
    5. | AM572x SR2.0 | 0x2B99002F |

    I hope I understood your questions correctly.


    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.