Wednesday, September 20th 2017, 8:07pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

richt123

Beginner

Date of registration: Dec 15th 2016

Posts: 3

1

Monday, December 19th 2016, 10:39am

JTAG Debugging of TI DRA74x [****** Error: CPU is not halted]

Hello,

I am working on a custom board that uses the TI DRA74x SoC.
I have configured the scan chain to expose the A15 and IPU0 M4 cores; however I can only successfully debug the A15.

dra74x.JLinkScript.zip

I have attached the working A15 JlinkScript. Altering the last line to SetCore(2) exposes the M4.
The M4 is being correctly initialised by the A15 and is executing code when I try to connect and I can use the "mem" command in JLinkExe.
For some reason, JLink thinks that the core is not halted, yet the code is paused (display animation output halts).
Is there a step that I am missing to tell JLink about the M4 in order to debug it correctly?
Any help is much appreciated.

I get the following error when using GDB:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$ JLinkGDBServer -ScriptFile dra74x.JLinkScript -device CORTEX-M4 -speed 8000
SEGGER J-Link GDB Server V6.12a Command Line Version

JLinkARM.dll V6.12a (DLL compiled Dec  2 2016 17:00:59)

-----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:      yes
Generate logfile:              off
Verify download:               off
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:                 dra74x.JLinkScript
J-Link settings file:          none
------Target related settings------
Target device:                 CORTEX-M4
Target interface:              JTAG
Target interface speed:        8000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V9 compiled Dec  2 2016 15:35:20
Hardware: V9.30
S/N: 59305236
Feature(s): GDB
Checking target voltage...
Target voltage: 3.38 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 4 JTAG devices, Total IRLen = 18
JTAG ID: 0x4BA00477 (Cortex-M4)
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.


The debug output from JLinkExe:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$ JLinkExe -JLinkScriptFile dra74x.JLinkScript -device CORTEX-M4 -speed 8000 -if jtag
SEGGER J-Link Commander V6.12a (Compiled Dec  2 2016 17:01:07)
DLL version V6.12a, compiled Dec  2 2016 17:00:59

Connecting to J-Link via USB...O.K.
Firmware: J-Link V9 compiled Dec  2 2016 15:35:20
Hardware version: V9.30
S/N: 59305236
License(s): GDB
VTref = 3.380V


Type "connect" to establish a target connection, '?' for help
J-Link>con
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Device "CORTEX-M4" selected.


DRA74x J-Link script
Could not measure total IR len. TDO is constant high.
Selected M4 Core #0
TotalIRLen = 18, IRPrint = 0x001111
AP-IDR: 0x24770011, Type: AHB-AP
Start searching for Cortex-M ROM table with ROMTable[0] @ 0xE00FF000.
ROMTable[-317433376]: Cortex-M ROM table found.
Found Cortex-M4 r0p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl 0 @ E00FF000
ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB000 SCS
ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
ROMTbl 0 [3]: FFF01000, CID: 00000000, PID: 00000000 ???
ROMTbl 0 [4]: FFF41000, CID: 00000000, PID: 00000000 ???
ROMTbl 0 [6]: FFF43000, CID: 00000000, PID: 00000000 ???
Found 4 JTAG devices, Total IRLen = 18:
 #0 Id: 0x3BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
 #1 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
 #2 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
 #3 Id: 0x0B99002F, IRLen: 06, IRPrint: 0x1, TI ICEPick
Cortex-M4 identified.
J-Link>mem 0x48975500 0x10
48975500 = 00 00 00 00 0A A1 40 00 D0 02 80 07 00 00 00 00 
J-Link>h

**************************
WARNING: CPU could not be halted
**************************

J-Link>mem 0x48975500 0x10
Could not read memory.
J-Link>

This post has been edited 1 times, last edit by "richt123" (Jan 6th 2017, 1:20pm)


SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,508

2

Monday, January 9th 2017, 10:31am

Hi,

From the script and from the output of J-Link Commander, it seems that basic identification of the M4 works fine.
However, when the read request is issued, it seems that the connection to the whole AHB-AP is lost as even reading memory fails after the failing halt request has been done.

Is the M4 in your case actually executing code or is it possible that the M4 is powered etc. but kept in reset?
From what I see in the output below, this is a typical effect of having a secondary core etc . powered but kept in reset (some debug registers are accessible via the AHB-AP, but actual debug requests to the core result in erroneous behavior)

Is it possible that the M4 is entering some kind of low power mode between the execution of code, that may cause this problem?
From what I can say, M4 support on J-Link is working 100% fine and in 99.9% of the cases, such problems on multi-core systems are configuration issues (reset active, secondary core reset by accident, secondary core not powered, ...)


Best regards
Alex

richt123

Beginner

Date of registration: Dec 15th 2016

Posts: 3

3

Monday, January 16th 2017, 12:30pm

Hi Alex,

The M4 is executing code. It is doing a simple animation on the HDMI display output.
When I initiate the connection, the animation stops implying that the M4 core is either halted or reset by the J-Link.
The rest of the system is not reset, as the display contents remain valid.

Kind regards,
Richard.

richt123

Beginner

Date of registration: Dec 15th 2016

Posts: 3

4

Monday, February 20th 2017, 2:53pm

Unfortunately we were unable to find a solution that works with JLink in time and had to go with a competitor.
The JLink is OK for A15 debugging, but not the M4.

I would still like to find a solution so that we can use JLink with this SoC for future engagements.