AnsweredAssumed Answered

Debugging Linux Kernel over JTAG with J-Link

Question asked by Peter Amond on Apr 23, 2018
Latest reply on May 3, 2018 by Yuri Muhin

Hi All,

 

My custom hardware is iMAX6Q processor based and similar to Nitrogen 6 max.

I'm referring to this link >> Debugging using Segger J-Link JTAG - Boundary Devices https://boundarydevices.com/debugging-using-segger-j-link-jtag/https://boundarydevices.com/debugging-using-segger-j-link-jtag/

 

1) In which boot mode we need to set the board when we are doing the kernel debug ? Do we need to load kernel via SD card ?

 

2) First I connected target hardware to JLink. Why it is showing No source available for 0x8ff532d4 ? Canyou see any mistake in following configurations. ?

 

 

Next ran the Eclipse.

Debug configurations as follows.

 

 

Launch Group as follows.

 

When I hit Debug I got following results.

 

 

 

Here is the Console log. >>

 

SEGGER J-Link GDB Server V6.30i Command Line Version

JLinkARM.dll V6.30i (DLL compiled Mar 23 2018 18:16:19)

Command line: -if jtag -device MCIMX6Q6 -endian little -speed auto -port 2340 -swoport 2341 -telnetport 2342 -vd -noreset -noir -localhostonly 1 -log /home/script/MCIMX6-core-3.JLinkScript -scriptfile MCIMX6-core-3.JLinkScript
-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2340
SWO raw output listening port: 2341
Terminal I/O port: 2342
Accept remote connection: localhost only
Generate logfile: on
Verify download: on
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: MCIMX6-core-3.JLinkScript
J-Link settings file: none
------Target related settings------
Target device: MCIMX6Q6
Target interface: JTAG
Target interface speed: auto
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Ultra V4 compiled Mar 2 2018 17:08:39
Hardware: V4.00
S/N: 504403136
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.29 V
Listening on TCP/IP port 2340
Connecting to target...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)

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)


J-Link found 3 JTAG devices, Total IRLen = 13
JTAG ID: 0x4BA00477 (Cortex-A9)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x00000001 (Data = 0x1CE59FF0)
Read 4 bytes @ address 0x1CE59FE8 (Data = 0x1187202C)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
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 2
Semihosting I/O set to GDB Client
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x00000001 (Data = 0x1CE59FF0)
Read 4 bytes @ address 0x1CE59FE8 (Data = 0x1187202C)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 2 bytes @ address 0x8FF5301C (Data = 0x0000)
Read 2 bytes @ address 0x8FF5301A (Data = 0xE12F)
Read 2 bytes @ address 0x8FF53018 (Data = 0xFF33)
Read 2 bytes @ address 0x8FF5301C (Data = 0x0000)
Read 2 bytes @ address 0x8FF5301A (Data = 0xE12F)
Read 2 bytes @ address 0x8FF53018 (Data = 0xFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x00000001 (Data = 0x1CE59FF0)
Read 4 bytes @ address 0x1CE59FE8 (Data = 0x1187202C)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 2 bytes @ address 0x8FF5301C (Data = 0x0000)
Read 2 bytes @ address 0x8FF5301A (Data = 0xE12F)
Read 2 bytes @ address 0x8FF53018 (Data = 0xFF33)
Read 2 bytes @ address 0x8FF5301C (Data = 0x0000)
Read 2 bytes @ address 0x8FF5301A (Data = 0xE12F)
Read 2 bytes @ address 0x8FF53018 (Data = 0xFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF53018 (Data = 0xE12FFF33)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x8FF5301C (Data = 0xE3500000)
Read 4 bytes @ address 0x00000001 (Data = 0x1CE59FF0)
Read 4 bytes @ address 0x1CE59FE8 (Data = 0x1187202C)
Received monitor command: regs
PC = 8FF532D4, CPSR = 600001D3 (SVC mode, ARM FIQ dis. IRQ dis.)
R0 = 00000000, R1 = 8FFBA1C1, R2 = 00000000, R3 = 00000001
R4 = 8FFB7694, R5 = 00000000, R6 = 8FFB9FAF, R7 = 00000001
USR: R8 =8FFA1298, R9 =8F335ED0, R10=8FF9269A, R11 =00000001, R12 =00002814
R13=00000000, R14=00000000
FIQ: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000
R13=00000000, R14=00000000, SPSR=D0010BB0
SVC: R13=8F335D88, R14=8FF5301C, SPSR=A20444BB
ABT: R13=00000000, R14=00000000, SPSR=80041A0C
IRQ: R13=00000000, R14=00000000, SPSR=8000902D
UND: R13=00000000, R14=00000000, SPSR=40030403
Reading all registers
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 2 bytes @ address 0x8FF532D4 (Data = 0xFF3E)
Read 2 bytes @ address 0x8FF532D2 (Data = 0xEAFF)
Read 2 bytes @ address 0x8FF532D0 (Data = 0xFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D0 (Data = 0xEAFFFFCB)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x8FF532D4 (Data = 0xEBFFFF3E)
Read 4 bytes @ address 0x00000001 (Data = 0x1CE59FF0)
Read 4 bytes @ address 0x1CE59FE8 (Data = 0x1187202C)
Starting target CPU...

 

 

3) While running an application on linux in my custom hardware design I'm getting kernel panics. How can I debug this using JTAG ?

 

4) How can I give certain command to run an application on custom hardware and get information when it is crashing using JTAG ?

 

Could you please give me some idea regarding this ?

 

Regards,

Peter. 

Outcomes