Debugging M4 through Eclipse imx7d

Dear All,

Following is output in eclipse when I am debugging a gpio demo code where the debugging doesn’t stop at main() - Can any one help as to how to proceed

Thanks

SEGGER J-Link GDB Server V6.70g Command Line Version

JLinkARM.dll V6.70g (DLL compiled Apr 23 2020 09:11:56)

Command line: -if jtag -device MCIMX7D7_M4 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui -scriptfile /opt/SEGGER/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:               on
Target connection timeout:     0 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 /opt/SEGGER/NXP_iMX7D_Connect_CortexM4.JLinkScript
J-Link settings file:          none
------Target related settings------
Target device:                 MCIMX7D7_M4
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware: V7.00
Feature(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
Checking target voltage...
Target voltage: 3.30 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)
Read 2 bytes @ address 0x00000000 (Data = 0x8000)
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 = 0x1FFF9BA4)
Received monitor command: regs
R0 = 30240000, R1 = 00000001, R2 = 00000001, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 20007FD8
R8 = 00000000, R9 = 00000000, R10= 1FFF8000, R11= 00000000
R12= 00000000, R13= 20007FD8, MSP= 20007FD8, PSP= 00000000
R14(LR) = 1FFF9B9F, R15(PC) = 1FFF9BA4
XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (1000 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 0x1FFF9BA4 (Data = 0x2B00B2DB)
Downloading 576 bytes @ address 0x00000000 - Verified OK
Downloading 13620 bytes @ address 0x1FFF8000 - Verified OK
Downloading 8 bytes @ address 0x1FFFB534 - Verified OK
Downloading 4 bytes @ address 0x1FFFB53C - Verified OK
Downloading 4 bytes @ address 0x1FFFB540 - Verified OK
Downloading 156 bytes @ address 0x20000000 - Verified OK
Writing register (PC = 0x1fff80b4)
Read 4 bytes @ address 0x1FFF80B4 (Data = 0xF8DFB672)
Read 2 bytes @ address 0x1FFF80B4 (Data = 0xB672)
Reading 64 bytes @ address 0x1FFF9D40
Read 2 bytes @ address 0x1FFF9D50 (Data = 0xF7FF)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x1FFF9BA4)
Read 2 bytes @ address 0x1FFF9D50 (Data = 0xF7FF)
Received monitor command: regs
R0 = 30240000, R1 = 00000001, R2 = 00000001, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 20007FD8
R8 = 00000000, R9 = 00000000, R10= 1FFF8000, R11= 00000000
R12= 00000000, R13= 20007FD8, MSP= 20007FD8, PSP= 00000000
R14(LR) = 1FFF9B9F, R15(PC) = 1FFF9BA4
XPSR 61000000, APSR 60000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Setting breakpoint @ address 0x1FFF9D50, Size = 2, BPHandle = 0x0001
Starting target CPU...
/opt/SEGGER/JLink/JLinkGUIServerExe: error while loading shared libraries: libQtGui.so.4: cannot open shared object file: No such file or directory
Reading all registers
Removing breakpoint @ address 0x1FFF9D50, Size = 2
WARNING: Could not remove breakpoint @ address 0x1FFF9D50
ERROR: Failed to set breakpoint at 0x1FFF9D50
WARNING: Failed to read memory @ address 0xEA4F22C8
WARNING: Failed to read memory @ address 0xEA4F22C8
Reading 64 bytes @ address 0xEA4F22C0
WARNING: Failed to read memory @ address 0xEA4F22C0
WARNING: Failed to read memory @ address 0xEA4F22C8

Welcome to Toradex Community.

We never tried to debug M4 with Eclipse.
However you can try to use ARM DS-5 as explained here.

The reason of above was not known, may be issue with Jlink. Will try and use a new Jlink and update.

Also with the above Jlink I was able to load code on to M4 but debugging stopped after some 20 seconds.

Running FreeRTOS Code requires reboot of board every time after deployment. Attached screenshots of Debug Settings.

Hi @gada.kashyap

Is the issue still present?

Best regards,
Jaski

Need to test with a new jlink which is on order after which I will update if this issue has resolved!

Thanks

Thanks for the update. We will wait for your feedback.

Best regards,
Jaski