Hello everyone,
after being able to connect to my target hardware (i.MX7D) using JLink.exe I wanted to integrate the JLINK in ARM MCU Eclipse.
I configured Eclipse based on gnu-mcu-eclipse.github.io/debug/jlink/
ON starting a debug session, Eclipse creates an error:
J-Link GDB Server failed:
Could not connect to target. Please check if target is powered and if ribbon cable is plugged properly.
For more details, see the JLinkGDBServerCL.exe console.
and my console outputs the following:
SEGGER J-Link GDB Server V6.22g Command Line Version
JLinkARM.dll V6.22g (DLL compiled Jan 17 2018 16:39:42)
Command line: -if swd -device MCIMX7D7_M4 -endian little -speed 100 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----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: none
J-Link settings file: none
------Target related settings------
Target device: MCIMX7D7_M4
Target interface: SWD
Target interface speed: 100kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jan 11 2018 10:41:05
Hardware: V10.10
S/N: 50117772
Feature(s): GDB
Checking target voltage...
Target voltage: 1.81 V
Listening on TCP/IP port 2331
Connecting to target...WARNING: CPU could not be halted
Halting target device failed. Trying again with reset
WARNING: CPU could not be halted
Failed to halt target device on connect
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.
Any idea why this might happen? I realized there is no script file attached.
Interesting is the target device that is listed as MCIMX7D7_M4, because in the project settings i have selected an MCIMX7D2 type. Manually changing the projectname_debug.launch file to the D2 results in
Failed to set device (MCIMX7D2_M4). Unknown device selected?ERROR : Failed to set device.
On the Segger compatible devices page, i dont see the MX7 being listed. May the JLink not be used with an MX7 in eclipse?
____________
On changing the device from M4 to A7_0 (without actually changing the project settings or target core or anything else) i get the following output (that doesnt work as expected, but connects at least):
Command line: -if swd -device MCIMX7D5_A7_0 -endian little -speed 100 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
[..]
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: MCIMX7D5_A7_0
[..]
Connecting to J-Link...
J-Link is connected.
[...]
Connecting to target...ERROR: Cortex-A/R-SWD (connect): Could not identify core via peripheral ID registers.
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
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 = 0x00000C60)
Received monitor command: regs
[...]
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (1000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (SVC Addr = 0x08)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 80000000 1000000 0x1 0
SWO enabled successfully.
WARNING: Failed to read memory @ address 0x00000C60
Downloading 12 bytes @ address 0x00008000 - Verify failed
[.. multiple failed attempts ..]
Writing register (PC = 0x0000800C)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x10084000)
WARNING: Failed to read memory @ address 0x0000800C
Received monitor command: regs
[.. multiple commands ..]
Reading all registers
Starting target CPU...
ERROR: Could not start CPU core. (ErrorCode: -1)
WARNING: Mis-aligned memory read: Address: 0xFFFFFFFF, NumBytes: 4, Alignment: 4 (Word-aligned)
Reading all registers
WARNING: Failed to read memory @ address 0x10084000
[...]
after being able to connect to my target hardware (i.MX7D) using JLink.exe I wanted to integrate the JLINK in ARM MCU Eclipse.
I configured Eclipse based on gnu-mcu-eclipse.github.io/debug/jlink/
ON starting a debug session, Eclipse creates an error:
J-Link GDB Server failed:
Could not connect to target. Please check if target is powered and if ribbon cable is plugged properly.
For more details, see the JLinkGDBServerCL.exe console.
and my console outputs the following:
SEGGER J-Link GDB Server V6.22g Command Line Version
JLinkARM.dll V6.22g (DLL compiled Jan 17 2018 16:39:42)
Command line: -if swd -device MCIMX7D7_M4 -endian little -speed 100 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
-----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: none
J-Link settings file: none
------Target related settings------
Target device: MCIMX7D7_M4
Target interface: SWD
Target interface speed: 100kHz
Target endian: little
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Jan 11 2018 10:41:05
Hardware: V10.10
S/N: 50117772
Feature(s): GDB
Checking target voltage...
Target voltage: 1.81 V
Listening on TCP/IP port 2331
Connecting to target...WARNING: CPU could not be halted
Halting target device failed. Trying again with reset
WARNING: CPU could not be halted
Failed to halt target device on connect
ERROR: Could not connect to target.
Target connection failed. GDBServer will be closed...Restoring target state and closing J-Link connection...
Shutting down...
Could not connect to target.
Please check power, connection and settings.
Any idea why this might happen? I realized there is no script file attached.
Interesting is the target device that is listed as MCIMX7D7_M4, because in the project settings i have selected an MCIMX7D2 type. Manually changing the projectname_debug.launch file to the D2 results in
Failed to set device (MCIMX7D2_M4). Unknown device selected?ERROR : Failed to set device.
On the Segger compatible devices page, i dont see the MX7 being listed. May the JLink not be used with an MX7 in eclipse?
____________
On changing the device from M4 to A7_0 (without actually changing the project settings or target core or anything else) i get the following output (that doesnt work as expected, but connects at least):
Command line: -if swd -device MCIMX7D5_A7_0 -endian little -speed 100 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -singlerun -strict -timeout 0 -nogui
[..]
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: MCIMX7D5_A7_0
[..]
Connecting to J-Link...
J-Link is connected.
[...]
Connecting to target...ERROR: Cortex-A/R-SWD (connect): Could not identify core via peripheral ID registers.
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
Read 4 bytes @ address 0x00000000 (Data = 0xE59FF018)
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 = 0x00000C60)
Received monitor command: regs
[...]
Reading all registers
Received monitor command: speed auto
Select auto target interface speed (1000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Received monitor command: semihosting enable
Semi-hosting enabled (SVC Addr = 0x08)
Received monitor command: semihosting IOClient 1
Semihosting I/O set to TELNET Client
Received monitor command: SWO DisableTarget 0xFFFFFFFF
SWO disabled successfully.
Received monitor command: SWO EnableTarget 80000000 1000000 0x1 0
SWO enabled successfully.
WARNING: Failed to read memory @ address 0x00000C60
Downloading 12 bytes @ address 0x00008000 - Verify failed
[.. multiple failed attempts ..]
Writing register (PC = 0x0000800C)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x10084000)
WARNING: Failed to read memory @ address 0x0000800C
Received monitor command: regs
[.. multiple commands ..]
Reading all registers
Starting target CPU...
ERROR: Could not start CPU core. (ErrorCode: -1)
WARNING: Mis-aligned memory read: Address: 0xFFFFFFFF, NumBytes: 4, Alignment: 4 (Word-aligned)
Reading all registers
WARNING: Failed to read memory @ address 0x10084000
[...]