[SOLVED] How to see the generic JLinkScript used to help write our own experimental one ?

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

  • [SOLVED] How to see the generic JLinkScript used to help write our own experimental one ?

    Dear all,


    I am currently working on the Zolertia Firefly Rev A board :

    github.com/Zolertia/Resources/wiki
    github.com/Zolertia/Resources/…fly/Hardware/Revision%20A

    It contains the :
    TI CC2538 ti.com/lit/ug/swru319c/swru319c.pdf
    so there is a Cortex-M3 and the ICE-Pick JTAG interface.

    I would like to be able to halt the CPU before or after the bootloader and debug with GDB (gdb-multiarch on Debian 64bits) the small OS already supported :

    -Contiki, RIOT, Openthread

    I just got the SEGGER JLink EDU mini and started to read the JLink documentation and I am not sure to understand what are the good practices for writing our own JLinkScript. Is there a way to see the generic JLinkScript or are we suppose to start from scratch ?

    It turns out that the JLink documentation UM08001 (6.34 Rev3) mentions several times that the ICEPick module is a bit tricky :
    - p116 some devices need special connect sequences (e.g. devices with TI ICEPick modules)
    - p170 (about InitTarget()) Example devices are MCUs from TI which have a so-called ICEPick JTAG unit on them that needs to be configured via JTAG, before the actual CPU core is accessible via JTAG.
    - p177 This function has to be called again, each time the JTAG chain changes (for dynamically changing JTAG chains like those which include a TI ICEPick), in order to setup the JTAG chain again.

    (by the way, I am not sure, but it seems there is an error on the definition of IRPre, DRPre, IRPost, DRPost ... sometimes IRPre is defined for devices closer to TDI, sometimes for those closer to TDO..)

    So now, let's suppose I want to "printf" some variables :

    C Source Code: zolertia.JLinkScript

    1. int SetupTarget (void) {
    2. int r;
    3. JLINK_SYS_Report("");
    4. JLINK_SYS_Report("Beginning of JLinkScript SetupTarget");
    5. r = JLINK_JTAG_GetDeviceId(0);
    6. JLINK_SYS_Report1("Device 0: ", r);
    7. r = JLINK_JTAG_GetDeviceId(1);
    8. JLINK_SYS_Report1("Device 1: ", r);
    9. JLINK_SYS_Report1("IRPre ",JLINK_JTAG_IRPre);
    10. JLINK_SYS_Report1("DRPre ",JLINK_JTAG_DRPre);
    11. JLINK_SYS_Report1("IRPost ",JLINK_JTAG_IRPost);
    12. JLINK_SYS_Report1("DRPost ",JLINK_JTAG_DRPost);
    13. JLINK_SYS_Report1("IRLen ",JLINK_JTAG_IRLen);
    14. JLINK_SYS_Report1("TotalIRLen ",JTAG_TotalIRLen);
    15. JLINK_SYS_Report("End of JLinkScript SetupTarget");
    16. JLINK_SYS_Report("");
    17. }
    Display All

    gives me :

    Source Code: zolertia.log

    1. ...
    2. InitTarget: Found ICE-Pick with ID: 0x8B96402F
    3. InitTarget: Found CPU TAP 0x4BA00477
    4. Scanning AP map to find all available APs
    5. AP[1]: Stopped AP scan as end of AP map has been reached
    6. AP[0]: AHB-AP (IDR: 0x24770011)
    7. Iterating through AP map to find AHB-AP to use
    8. AP[0]: Core found
    9. AP[0]: AHB-AP ROM base: 0xE00FF000
    10. CPUID register: 0x412FC230. Implementer code: 0x41 (ARM)
    11. Found Cortex-M3 r2p0, Little endian.
    12. FPUnit: 6 code (BP) slots and 2 literal slots
    13. CoreSight components:
    14. ROMTbl[0] @ E00FF000
    15. ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 002BB000 SCS
    16. ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 002BB002 DWT
    17. ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 002BB003 FPB
    18. ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 002BB001 ITM
    19. ROMTbl[0][4]: E0040000, CID: B105900D, PID: 002BB923 TPIU-Lite
    20. Beginning of JLinkScript SetupTarget
    21. Device 0: 0x4BA00477
    22. Device 1: 0x8B96402F
    23. IRPre 0x00000000
    24. DRPre 0x00000000
    25. IRPost 0x00000006
    26. DRPost 0x00000001
    27. IRLen 0x00000004
    28. TotalIRLen 0x0000000A
    29. End of JLinkScript SetupTarget
    30. Cortex-M3 identified.
    31. J-Link>
    Display All

    But if I would like to understand :
    - what was the Default InitTarget() used
    And if I would like to understand/experiment with the reset strategies beyond the RSetType command and read what was the ResetTarget() and AfterResetTarget() functions actually used, I would prefer not start from scratch.

    Of course there are some ICEPick JLinkScript available :
    - /opt/SEGGER/JLink_V632i/Devices/TI/TI_CC3200.JLinkScript
    - /opt/SEGGER/JLink_V632i/Devices/Cypress/PSoC6/CY8C6xxx_CM0p_tm_xA.JLinkScript
    - /opt/SEGGER/JLink_V632i/Samples/JLink/Scripts/ScriptBeagleBoard_OMAP3530.JLinkScript ( still using __int64)

    but there are not for the same board and it would be much easier if there was some way to dump the "generic" procedure. Or at least a very verbose++++ mode. I havn't seen any differences with this for example :

    C Source Code: zoltertia2.JLinkScript

    1. int ConfigTargetSettings(void) {
    2. JLINK_SYS_Report("");
    3. JLINK_SYS_Report("Beginning of JLinkScript ConfigTargetSettings");
    4. JLINK_ExecCommand("EnableRemarks");
    5. JLINK_SYS_Report("End of JLinkScript ConfigTargetSettings");
    6. JLINK_SYS_Report("");
    7. return 0;
    8. }
    Can you please provide a way to understand what is the generic procedure because it's very hard to write JLinkScript from scratch and adapt TI_CC3200.JLinkScript

    Thank you in advance for any advice !

    A.
  • Hello,

    Thank you for your inquiry.
    Regarding the generic init procedure we will contact you via PM.
    For general questions about ICEPick we suggest contacting TI.
    This thread will be closed now.

    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.