[SOLVED] JLink-Base iMX7D (M4) eclipse debugging problem

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

  • [SOLVED] JLink-Base iMX7D (M4) eclipse debugging problem

    Hello,

    I'm trying to debug an application on the Cortex-M4 of my iMX7D using the Segger JLink-Base debugger.
    The debugging works correctly using Ozone.

    But unfortunately I can't do it using eclipse.
    The debugger configuration and the result screen shots from eclipse are attached.
    I'm using the Eclipse IDE for C/C++ Developers Version: 2019-03 (4.11.0)
    I used the NXP linker from Segger



    If I don't run a firmware on M4, the J-Link GDB server fails even to run with a message:
    Could not connect to target. Please check if target is powered and if ribbon cable is plugged properly.

    After running a firmware using the u-boot. The debugger stucks at: "starting target CPU".


    The console log: ---------------------------------------------------------------------------------------------------

    SEGGER J-Link GDB Server V6.46a Command Line Version

    JLinkARM.dll V6.46a (DLL compiled May 27 2019 16:35:08)

    Command line: -if jtag -device MCIMX7D7_M4 -endian little -speed auto -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -jlinkscriptfile /home/majd/NXP_iMX7D_Connect_CortexM4.JLinkScript
    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: localhost only
    Generate logfile: off
    Verify download: on
    Init regs on start: on
    Silent mode: off
    Single run mode: off
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: /home/majd/NXP_iMX7D_Connect_CortexM4.JLinkScript
    J-Link settings file: none
    ------Target related settings------
    Target device: MCIMX7D7_M4
    Target interface: JTAG
    Target interface speed: auto
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled May 27 2019 15:48:59
    Hardware: V10.10
    S/N: 50124514
    Feature(s): GDB
    Checking target voltage...
    Target voltage: 3.35 V
    Listening on TCP/IP port 2331
    Connecting to target...
    J-Link found 1 JTAG device, Total IRLen = 4
    JTAG ID: 0x4BA00477 (Cortex-M4)
    Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20008000)
    Received monitor command: speed 1000
    Target interface speed set to 1000 kHz
    Received monitor command: clrbp
    Received monitor command: reset
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x1FFFA73E)
    Received monitor command: regs
    R0 = 30610000, R1 = 00000000, R2 = A30007E0, R3 = 30610000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 20007FE8
    R8 = 00000000, R9 = 00000000, R10= 1FFF8000, R11= 00000000
    R12= 00000000, R13= 20007FE8, MSP= 20007FE8, PSP= 00000000
    R14(LR) = 1FFFA73F, R15(PC) = 1FFFA73E
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x1FFFA73E (Data = 0xD768E7FE)
    Received monitor command: speed 4000
    Target interface speed set to 4000 kHz
    Received monitor command: flash breakpoints 0
    Flash breakpoints disabled
    Received monitor command: semihosting enable
    Semi-hosting enabled (Handle on BKPT)
    Received monitor command: semihosting IOClient 1
    Semihosting I/O set to TELNET Client
    Received monitor command: reset 0
    Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    Read 4 bytes @ address 0x1FFFA73E (Data = 0xD768E7FE)
    Downloading 576 bytes @ address 0x00000000 - Verified OK
    Downloading 4096 bytes @ address 0x1FFF8000 - Verified OK
    Downloading 4096 bytes @ address 0x1FFF9000 - Verified OK
    Downloading 4096 bytes @ address 0x1FFFA000 - Verified OK
    Downloading 4096 bytes @ address 0x1FFFB000 - Verified OK
    Downloading 4096 bytes @ address 0x1FFFC000 - Verified OK
    Downloading 3128 bytes @ address 0x1FFFD000 - Verified OK
    Downloading 8 bytes @ address 0x1FFFDC38 - Verified OK
    Downloading 4 bytes @ address 0x1FFFDC40 - Verified OK
    Downloading 4 bytes @ address 0x1FFFDC44 - Verified OK
    Downloading 464 bytes @ address 0x20000000 - Verified OK
    Writing register (PC = 0x1fff80b4)
    Read 4 bytes @ address 0x1FFF80B4 (Data = 0xF8DFB672)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Received monitor command: clrbp
    Received monitor command: reset
    Resetting target
    Received monitor command: halt
    Halting target CPU...
    ...Target halted (PC = 0x1FFFA73E)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Read 2 bytes @ address 0x1FFFA6C6 (Data = 0x4A1E)
    Received monitor command: regs
    R0 = 30610000, R1 = 00000000, R2 = A30007E0, R3 = 30610000
    R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 20007FE8
    R8 = 00000000, R9 = 00000000, R10= 1FFF8000, R11= 00000000
    R12= 00000000, R13= 20007FE8, MSP= 20007FE8, PSP= 00000000
    R14(LR) = 1FFFA73F, R15(PC) = 1FFFA73E
    XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
    CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
    Reading all registers
    Read 4 bytes @ address 0x1FFFA73E (Data = 0xD768E7FE)
    Setting breakpoint @ address 0x1FFFA6C6, Size = 2, BPHandle = 0x0001
    Starting target CPU...

    ------------------------------------------------------------------------------------------------------------------


    Thanks for your help in advance.


    Best regards,
    Majd
    Images
    • debugger-settings2.png

      198.41 kB, 1,256×889, viewed 926 times
    • eclipse.png

      197.09 kB, 1,256×889, viewed 709 times
    • debugger-settings1.png

      221.22 kB, 1,256×889, viewed 757 times
  • Hello Majd,

    Thank you for your inquiry.
    Such an issue is not known to us.
    As it seems to be working in Ozone but not in Eclipse the reason for this behaviour most likely lies in the sequence used by Eclipse for connection which does not seem to be working.
    Please understand that we can't provide assistance for issues in software that is not created or maintained by us.
    We suggest using Ozone instead.

    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.