[SOLVED] J-Link EDU debugging with NXP iMX6Q

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

  • [SOLVED] J-Link EDU debugging with NXP iMX6Q

    Hi, all

    I have a J-Link EDU connected to an NXP iMX6Q which has 2G RAM and 16G emmc, but it can't debug program with eclipse.
    Becasuse the GDB server always shows following lines after I clicked debug icon.

    Downloading 12 bytes @ address 0x00008000 - Verify failed
    Downloading 4096 bytes @ address 0x0000800C - Verify failed
    Downloading 4096 bytes @ address 0x0000900C - Verify failed
    Downloading 108 bytes @ address 0x0000A00C - Verify failed
    Downloading 12 bytes @ address 0x0000A078 - Verify failed
    Downloading 32 bytes @ address 0x0000A084 - Verify failed
    Downloading 8 bytes @ address 0x0000A0A4 - Verify failed
    Downloading 4 bytes @ address 0x0000A0AC - Verify failed
    Downloading 8 bytes @ address 0x0001A0B0 - Verify failed
    Downloading 4 bytes @ address 0x0001A0B8 - Verify failed
    Downloading 4 bytes @ address 0x0001A0BC - Verify failed
    Downloading 2384 bytes @ address 0x0001A0C0 - Verify failed
    Writing register (PC = 0x0000809C)
    Writing register (CPSR = 0x800001F3)
    WARNING: Failed to read memory @ address 0x0000809C
    Received monitor command: clrbp
    Received monitor command: reset

    I find this development board doesn't support internal flash for user, because 0x0000000~0x00017fff is belong to iROM.
    And J-Flash Lite or eclipse can't download elf file to a specified address either.

    So,
    does it mean that I should buy a JFlash license for EDU or buy a new J-LINK ULTRA+ so that I can download elf file to emmc for debugging ?
  • Hi,

    In order to narrow down the list of possible causes of this issue:
    Could you please give J-Link Commander a try?
    J-Link commander is part of the J-Link software package, which is available free of charge here .

    • Start J-Link Commander (jlink.exe)
    • Type "connect" in order to start a debug session
    • Type in the target device name if asked (Or type "?" for a target selection Dialog)
    • Choose the correct target interface (JTAG/SWD/etc..)
    • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
    • [JTAG only]JTAG conf can be default(most of the times)
    • You should now be successfully connected.
    • It is now possible to program a binary file via the >loadfile< command (works with .bin/.hex/.srec/.s19/etc. files).
    • The commands >r<, >g<, >h<, >s< can be used for reset, go, halt and step.
    • Breakpoints can be set by using the >setbp< command.
    If anything fails, could you please post a screenshot of the complete session?

    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, and I had a try yesterday.
    The result shows that this simulator works well, all commands go on the right way.
    My debug environment is eclipse + J-LINK EDU simulator + J-LINK GDB server.


    I check the .elf file and find that VMA is default set as 0x00000000 by linker script.
    And the iMX6Q memory map shows address 0x00000000~0x00017fff is read only.
    I think it means this board do not have a programmed internal flash.


    Since I use J-LINK EDU to debug, it's not available for flash downloading.
    So, I started uboot on iMX6Q and changed the VMA to a legal ddr address such as 0x10000000 so that I could download .elf file on ddr via J-LINK and debug.
    But it turns out useless, because simulator will reset CPU after download is done.


    Now, I am wondering if that I should add licenses for J-LINK EDU or buy another J-LINK ULTRA+ so that I can program on external flash such as emmc.
    Do you have some advice about how to program emmc on iMX6Q board ?

    Following is the output of J-LINK EDU connecting to iMX6Q :


    Connecting to J-Link via USB...O.K.
    Firmware: J-Link V10 compiled Jun 16 2017 16:15:19
    Hardware version: V10.10
    S/N: 260101769
    License(s): FlashBP, GDB
    OEM: SEGGER-EDU
    VTref = 3.270V


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


    Connecting to target via JTAG
    TotalIRLen = 13, IRPrint = 0x0101

    **************************
    WARNING: At least one of the connected devices is not JTAG compliant (IEEE Std 1149.1, 7.1.1.d, IR-cells). (NumDevices = 3, NumBitsSet = 2)

    **************************

    JTAG chain detection found 3 devices:
    #0 Id: 0x4BA00477, IRLen: 04, CoreSight JTAG-DP
    #1 Id: 0x00000001, IRLen: ?, Unknown device
    #2 Id: 0x2191C01D, IRLen: ?, Unknown device
    ARM AP[0]: 0x44770001, AHB-AP
    ARM AP[1]: 0x24770002, APB-AP
    ROMTbl[0][0]: CompAddr: 82141000 CID: B105900D, PID:04-003BB907 ETB
    ROMTbl[0][1]: CompAddr: 82142000 CID: B105900D, PID:04-002BB906 ECT / CTI
    ROMTbl[0][2]: CompAddr: 82143000 CID: B105900D, PID:04-004BB912 TPIU
    ROMTbl[0][3]: CompAddr: 82144000 CID: B105900D, PID:04-001BB908 CSTF
    ROMTbl[0][4]: CompAddr: 8214F000 CID: B105100D, PID:04-000BB4A9 ROM Table
    ROMTbl[1][0]: CompAddr: 82150000 CID: B105900D, PID:04-000BBC09 Cortex-A9
    Found Cortex-A9 r2p10
    6 code breakpoints, 4 data breakpoints
    Debug architecture ARMv7.0
    Data endian: little
    Main ID register: 0x412FC09A
    I-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
    System control register:
    Instruction endian: little
    Level-1 instruction cache enabled
    Level-1 data cache enabled
    MMU disabled
    Branch prediction enabled
    Cortex-A9 identified.
    J-Link>

    Best regards,
    Tcer

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

  • Hi,

    So, I started uboot on iMX6Q and changed the VMA to a legal ddr address such as 0x10000000 so that I could download .elf file on ddr via J-LINK and debug.
    But it turns out useless, because simulator will reset CPU after download is done.

    This is not a default behavior of J-Link, therefore the reset is probably issued by eclipse.
    Or this also occur via J-Link Commander?

    Do you want to give Ozone - The J-Link Debugger a try?
    You can build the executable as usual (make sure its located at the correct address) and then use Ozone as a debugger.

    Ozone can be used for evaluation purposes free of charge with any J-Link. J-Link Plus or higher ship with a burned-in unlimited license for Ozone.
    • Start Ozone
    • In the startup-dialog, select Create New Project
    • Click on the Button "..." to the right of the Device Box and select your target device (Selecting only the core will only work when debugging in RAM)
    • Click Next
    • Choose the correct target interface (JTAG/SWD/etc..)
    • Use a valid speed (Default: 4000kHz, try 100-500 if default does not work)
    • Click Next
    • Click on the Button "..." in order to select a Data file (the .elf file / .out file/ etc build by the IDE)
    • Click Finish
    • enter Project.SetJLinkScript (<path to scriptfile>) in the console in order to use the J-Link script file
    • Press F5 or click the green on/off button in the left upper corner
    • The debug session should be ready to use
    If anything fails, could you please post a screenshot of the complete session, and copy paste the complete contents of the Console window?

    Now, I am wondering if that I should add licenses for J-LINK EDU or buy another J-LINK ULTRA+

    J-Link EDU cannot be extended with additional licenses and may only be used for education and evaluation purposes.
    Please note if your using J-Link and/or features like Flash-Breakpoints, J-Flash or Ozone beyond evaluation or education purpose, you need to acquire a J-Link PLUS or higher.

    [...] so that I can program on external flash such as emmc.
    Do you have some advice about how to program emmc on iMX6Q board ?

    Programming of the emmc flash memory of the iMX6Q is not supported natively by J-Link, since it is not memory-mapped available.
    However, flash programming support can be added via the open flash loader feature of J-Link by following the instructions in this article wiki.segger.com/Adding_Support_for_New_Devices and the chapter "Open Flashloader" of UM8001.
    You can either implement this yourself or get in touch with support@segger.com regarding a custom order. Please note that this order will come at the cost of NREs and that the management decides if this order would fit in our project schedule, as we are currently quite booked with other projects.



    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, Nikals


    Thanks for your advice very much !

    I find it was eclipse that resets J-LINK as default after downloading *.elf file.
    And now I am succeed in debugging IMX6Q when I canceled the option of eclipse.

    I check your offical website and find there are so many amazing functions on J-LINK.
    But, I am afraid these funcitons might a little expensive for me, since I am just a college student in China who are hardly able to increase the budget on this project.


    So, I have to go on with J-LINK EDU, it seems like enough for me now after all.

    Anyway, I really appreciate for your help in solving this problem.

    Best regards,
    Tcer
  • Hi Tcer,


    And now I am succeed in debugging IMX6Q when I canceled the option of eclipse.
    I check your offical website and find there are so many amazing functions on J-LINK.

    Good to hear that your are up and running again and thanks for the "flowers"!

    But, I am afraid these funcitons might a little expensive for me, since I am just a college student in China who are hardly able to increase the budget on this project.

    Please note that many functions of J-Link can be used free of charge with J-Link EDU, like SystemView:
    segger.com/products/development-tools/about-systemview/
    Free tool. No license cost, no hidden fees

    and others, like Embedded Studio, come with a free license for non commercial usage e.g. colleges / universities:

    segger.com/products/developmen…e/non-commercial-license/ :

    Educational purposes in the context of the non commercial license terms allows using Embedded Studio
    • by students, tutors, teachers, or private individuals
    • in universities, colleges, non-profit organizations, or at home
    • for courses, classes, training, and self-education.


    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.