CX3 Segger JLink debugger issues

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am using an Econ Denebola board (which uses a CX3)

   

I followed the steps in EzUsbSuite_UG.pdf section 3.1 Debugging using Segger J-Link to configure my Segger Jlink pro debugger.

   

[1] The Denebola board has a number of boot modi which you can select via dip switches, if i select the default 'boot from spi flash' boot option i cannot connect with the debugger. The JLinkGDBServerCL console output says:

   

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

   

JLinkARM.dll V6.12g (DLL compiled Jan 27 2017 18:18:51)

   

-----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:                 ARM9
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little

   

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware: V4.00
S/N: 174300742
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.28 V
Listening on TCP/IP port 2331
Connecting to target...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.

   

I did quite a lot of experimenting in this mode, one of the more strange observations is that if i start Jlink.exe from the command line, run 'connect' (a command which does not seem to have an explanation in the help for some reason) and enter ARM9/JTAG/autodetect/1000khz the connect fails. If i run 'usb' it also fails. But if I then press the reset button, then run 'usb' again then it succeeds in connecting for a while, but if i keep entering 'i' i see that after a few seconds the connection fails again. Output:

   

C:\Program Files (x86)\SEGGER\JLink_V612g>jlink
SEGGER J-Link Commander V6.12g (Compiled Jan 27 2017 18:19:20)
DLL version V6.12g, compiled Jan 27 2017 18:18:51

   

Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.279V

   


Type "connect" to establish a target connection, '?' for help
J-Link>usb
Disconnecting from J-Link...O.K.
Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.279V
J-Link>connect
Please specify device / core. <Default>: ARM9
Type '?' for selection dialog
Device>ARM9
Please specify target interface:
  J) JTAG (Default)
TIF>
Device position in JTAG chain (IRPre,DRPre) <Default>: -1,-1 => Auto-detect
JTAGConf>
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>1000
Device "ARM9" selected.

   


TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
Cannot connect to target.
J-Link>usb
Disconnecting from J-Link...O.K.
Disconnecting from J-Link...O.K.
Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.279V
Device "ARM9" selected.

   


TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
Cannot connect to target.

   

[Here i reset the board]
J-Link>usb
Disconnecting from J-Link...O.K.
Disconnecting from J-Link...O.K.
Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.279V
Device "ARM9" selected.

   


TotalIRLen = 4, IRPrint = 0x01
CP15.0.0: 0x41069265: ARM, Architecure 5TEJ
CP15.0.1: 0x1D112112: ICache: 8kB (4*64*32), DCache: 8kB (4*64*32)
Cache type: Separate, Write-back, Format C (WT supported)
Found 1 JTAG device, Total IRLen = 4:
 #0 Id: 0x07926069, IRLen: 04, IRPrint: 0x1, ARM926EJ-S Core
ARM9 identified.
J-Link>i
JTAG Id: 0x00000000: INVALID
J-Link>i
JTAG Id: 0x00000000: INVALID
J-Link>i
JTAG Id: 0x00000000: INVALID
J-Link>usb
Disconnecting from J-Link...O.K.
Disconnecting from J-Link...O.K.
Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.280V
Device "ARM9" selected.

   


TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
Cannot connect to target.
J-Link>usb
Disconnecting from J-Link...O.K.
Disconnecting from J-Link...O.K.
Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware version: V4.00
S/N: 174300742
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: DHCP (no addr. received yet)
VTref = 3.280V
Device "ARM9" selected.

   


TotalIRLen = 4, IRPrint = 0x01
CP15.0.0: 0x41069265: ARM, Architecure 5TEJ
CP15.0.1: 0x1D112112: ICache: 8kB (4*64*32), DCache: 8kB (4*64*32)
Cache type: Separate, Write-back, Format C (WT supported)
Found 1 JTAG device, Total IRLen = 4:
 #0 Id: 0x07926069, IRLen: 04, IRPrint: 0x1, ARM926EJ-S Core
ARM9 identified.
J-Link>i
JTAG Id: 0x07926069  Version: 0x0 Part no: 0x7926 Man. Id: 0034
J-Link>i
JTAG Id: 0x07926069  Version: 0x0 Part no: 0x7926 Man. Id: 0034
J-Link>i
JTAG Id: 0x07926069  Version: 0x0 Part no: 0x7926 Man. Id: 0034
J-Link>i
JTAG Id: 0x07926069  Version: 0x0 Part no: 0x7926 Man. Id: 0034
J-Link>i
JTAG Id: 0x07926069  Version: 0x0 Part no: 0x7926 Man. Id: 0034
J-Link>i
JTAG Id: 0x00000000: INVALID
J-Link>i
JTAG Id: 0x00000000: INVALID
J-Link>

   

Not sure what to think of that, is the connection 'unstable', does the chip makes itself 'unavailable' somehow over JTAG, ... ?

   

[2] With that idea in mind i changed to bootmode to start the USB boot mode. Using Jlink.exe and pressing i now the connection seems to be stable.

   

And if I try connecting in Eclipse it also works a "little bit". By that i mean i reach the main, i can step there, but if I eg put a breakpoint in the beginning of the function CyFxApplicationDefine and press Resume (F8), 95% of the time it will not work and i will get an error:

   

Starting target CPU...
ERROR: Bad JTAG communication: Write to IR: Expected 0x1, got 0x0 (TAP Command : 2) @ Off 0x5.

   

 

   

Any suggestions ? It seems the hardware connections etc are fine since it works to some degree. If I google that error i get suggestions that it means the CPU is in a 'bad state' but that does not help me much.

   

Is there anyone with a similar setup for who it works reliably ?

   

 

   

PS full console output for reference (loading the project, getting to main, setting a few breakpoints with one in CyFxApplicationDefine and resuming):

   

 

   

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

   

JLinkARM.dll V6.12g (DLL compiled Jan 27 2017 18:18:51)

   

-----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:                 ARM9
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little

   

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link Pro V4 compiled Jan 25 2017 15:46:53
Hardware: V4.00
S/N: 174300742
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.28 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 1 JTAG device, Total IRLen = 4
JTAG ID: 0x07926069 (ARM9)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xE4D79D65)
Target interface speed set to 1000 kHz
WARNING: PC of target system has unexpected value of 0xF0001F4C after reset.
Resetting target
Halting target CPU...
...Target halted (PC = 0x00000000)
PC = 00000000, CPSR = 000000D3 (SVC mode, ARM FIQ dis. IRQ dis.)
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
USR: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000
     R13=00000000, R14=00000000
FIQ: R8 =00000000, R9 =00000000, R10=00000000, R11 =00000000, R12 =00000000
     R13=00000000, R14=00000000, SPSR=00000010
SVC: R13=00000000, R14=00000000, SPSR=00000010
ABT: R13=00000000, R14=00000000, SPSR=00000010
IRQ: R13=00000000, R14=00000000, SPSR=00000010
UND: R13=00000000, R14=00000000, SPSR=00000010
Reading all registers
Select auto target interface speed (8000 kHz)
Flash breakpoints disabled
Downloading 10824 bytes @ address 0x00000100 - Verified OK
Downloading 16256 bytes @ address 0x40003000 - Verified OK
Downloading 16272 bytes @ address 0x40006F80 - Verified OK
Downloading 16288 bytes @ address 0x4000AF10 - Verified OK
Downloading 16240 bytes @ address 0x4000EEB0 - Verified OK
Downloading 16144 bytes @ address 0x40012E20 - Verified OK
Downloading 16192 bytes @ address 0x40016D30 - Verified OK
Downloading 16272 bytes @ address 0x4001AC70 - Verified OK
Downloading 16320 bytes @ address 0x4001EC00 - Verified OK
Downloading 4872 bytes @ address 0x40022BC0 - Verified OK
Downloading 24 bytes @ address 0x40023EC8 - Verified OK
Downloading 48 bytes @ address 0x40023EE0 - Verified OK
Downloading 404 bytes @ address 0x40023F10 - Verified OK
Downloading 64 bytes @ address 0x400240A4 - Verified OK
Downloading 16 bytes @ address 0x400240E4 - Verified OK
Downloading 16 bytes @ address 0x400240F4 - Verified OK
Downloading 16 bytes @ address 0x40024104 - Verified OK
Downloading 16 bytes @ address 0x40024114 - Verified OK
Downloading 208 bytes @ address 0x40024124 - Verified OK
Downloading 628 bytes @ address 0x400241F4 - Verified OK
Downloading 168 bytes @ address 0x40024468 - Verified OK
Downloading 116 bytes @ address 0x40024510 - Verified OK
Downloading 40 bytes @ address 0x40024584 - Verified OK
Downloading 40 bytes @ address 0x400245AC - Verified OK
Downloading 40 bytes @ address 0x400245D4 - Verified OK
Downloading 40 bytes @ address 0x400245FC - Verified OK
Downloading 40 bytes @ address 0x40024624 - Verified OK
Downloading 40 bytes @ address 0x4002464C - Verified OK
Downloading 40 bytes @ address 0x40024674 - Verified OK
Downloading 40 bytes @ address 0x4002469C - Verified OK
Downloading 48 bytes @ address 0x400246C4 - Verified OK
Downloading 104 bytes @ address 0x400246F4 - Verified OK
Downloading 20 bytes @ address 0x4002475C - Verified OK
Downloading 84 bytes @ address 0x40024770 - Verified OK
Downloading 48 bytes @ address 0x400247C4 - Verified OK
Downloading 24 bytes @ address 0x400247F4 - Verified OK
Downloading 24 bytes @ address 0x4002480C - Verified OK
Downloading 60 bytes @ address 0x40024824 - Verified OK
Downloading 48 bytes @ address 0x40024860 - Verified OK
Downloading 44 bytes @ address 0x40024890 - Verified OK
Downloading 128 bytes @ address 0x400248BC - Verified OK
Downloading 148 bytes @ address 0x4002493C - Verified OK
Downloading 208 bytes @ address 0x400249D0 - Verified OK
Downloading 60 bytes @ address 0x40024AA0 - Verified OK
Downloading 136 bytes @ address 0x40024ADC - Verified OK
Downloading 56 bytes @ address 0x40024B64 - Verified OK
Downloading 132 bytes @ address 0x40024B9C - Verified OK
Downloading 120 bytes @ address 0x40024C20 - Verified OK
Downloading 364 bytes @ address 0x40024C98 - Verified OK
Downloading 1092 bytes @ address 0x40024E04 - Verified OK
Downloading 172 bytes @ address 0x40025248 - Verified OK
Downloading 120 bytes @ address 0x400252F4 - Verified OK
Downloading 180 bytes @ address 0x4002536C - Verified OK
Downloading 332 bytes @ address 0x40025420 - Verified OK
Downloading 452 bytes @ address 0x4002556C - Verified OK
Downloading 240 bytes @ address 0x40025730 - Verified OK
Downloading 216 bytes @ address 0x40025820 - Verified OK
Downloading 16 bytes @ address 0x400258F8 - Verified OK
Downloading 16 bytes @ address 0x40025908 - Verified OK
Downloading 92 bytes @ address 0x40025918 - Verified OK
Downloading 232 bytes @ address 0x40025974 - Verified OK
Downloading 212 bytes @ address 0x40025A5C - Verified OK
Downloading 68 bytes @ address 0x40025B30 - Verified OK
Downloading 536 bytes @ address 0x40025B74 - Verified OK
Downloading 80 bytes @ address 0x40025D8C - Verified OK
Downloading 400 bytes @ address 0x40025DDC - Verified OK
Downloading 92 bytes @ address 0x40025F6C - Verified OK
Downloading 276 bytes @ address 0x40025FC8 - Verified OK
Downloading 240 bytes @ address 0x400260DC - Verified OK
Downloading 444 bytes @ address 0x400261CC - Verified OK
Downloading 68 bytes @ address 0x40026388 - Verified OK
Downloading 544 bytes @ address 0x400263CC - Verified OK
Downloading 560 bytes @ address 0x400265EC - Verified OK
Downloading 16 bytes @ address 0x4002681C - Verified OK
Downloading 304 bytes @ address 0x4002682C - Verified OK
Downloading 104 bytes @ address 0x4002695C - Verified OK
Downloading 276 bytes @ address 0x400269C4 - Verified OK
Downloading 256 bytes @ address 0x40026AD8 - Verified OK
Downloading 452 bytes @ address 0x40026BD8 - Verified OK
Downloading 1540 bytes @ address 0x40026D9C - Verified OK
Downloading 324 bytes @ address 0x400273A0 - Verified OK
Downloading 236 bytes @ address 0x400274E4 - Verified OK
Downloading 580 bytes @ address 0x400275D0 - Verified OK
Downloading 80 bytes @ address 0x40027814 - Verified OK
Downloading 272 bytes @ address 0x40027864 - Verified OK
Downloading 400 bytes @ address 0x40027974 - Verified OK
Downloading 320 bytes @ address 0x40027B04 - Verified OK
Downloading 128 bytes @ address 0x40027C44 - Verified OK
Downloading 192 bytes @ address 0x40027CC4 - Verified OK
Downloading 104 bytes @ address 0x40027D84 - Verified OK
Downloading 376 bytes @ address 0x40027DEC - Verified OK
Downloading 128 bytes @ address 0x40027F64 - Verified OK
Downloading 212 bytes @ address 0x40027FE4 - Verified OK
Downloading 160 bytes @ address 0x400280B8 - Verified OK
Downloading 440 bytes @ address 0x40028158 - Verified OK
Downloading 160 bytes @ address 0x40028310 - Verified OK
Downloading 160 bytes @ address 0x400283B0 - Verified OK
Downloading 160 bytes @ address 0x40028450 - Verified OK
Downloading 612 bytes @ address 0x400284F0 - Verified OK
Downloading 116 bytes @ address 0x40028754 - Verified OK
Downloading 160 bytes @ address 0x400287C8 - Verified OK
Downloading 52 bytes @ address 0x40028868 - Verified OK
Downloading 64 bytes @ address 0x4002889C - Verified OK
Downloading 64 bytes @ address 0x400288DC - Verified OK
Downloading 136 bytes @ address 0x4002891C - Verified OK
Downloading 456 bytes @ address 0x400289A4 - Verified OK
Downloading 64 bytes @ address 0x40028B6C - Verified OK
Downloading 712 bytes @ address 0x40028BAC - Verified OK
Downloading 208 bytes @ address 0x40028E74 - Verified OK
Downloading 600 bytes @ address 0x40028F44 - Verified OK
Downloading 440 bytes @ address 0x4002919C - Verified OK
Downloading 460 bytes @ address 0x40029354 - Verified OK
Downloading 588 bytes @ address 0x40029520 - Verified OK
Downloading 720 bytes @ address 0x4002976C - Verified OK
Downloading 1512 bytes @ address 0x40029A3C - Verified OK
Downloading 168 bytes @ address 0x4002A024 - Verified OK
Downloading 472 bytes @ address 0x4002A0CC - Verified OK
Downloading 732 bytes @ address 0x4002A2A4 - Verified OK
Downloading 756 bytes @ address 0x4002A580 - Verified OK
Downloading 136 bytes @ address 0x4002A874 - Verified OK
Downloading 1236 bytes @ address 0x4002A8FC - Verified OK
Downloading 524 bytes @ address 0x4002ADD0 - Verified OK
Downloading 956 bytes @ address 0x4002AFDC - Verified OK
Downloading 1120 bytes @ address 0x4002B398 - Verified OK
Downloading 940 bytes @ address 0x4002B7F8 - Verified OK
Downloading 828 bytes @ address 0x4002BBA4 - Verified OK
Downloading 424 bytes @ address 0x4002BEE0 - Verified OK
Downloading 416 bytes @ address 0x4002C088 - Verified OK
Downloading 752 bytes @ address 0x4002C228 - Verified OK
Downloading 464 bytes @ address 0x4002C518 - Verified OK
Downloading 156 bytes @ address 0x4002C6E8 - Verified OK
Downloading 212 bytes @ address 0x4002C784 - Verified OK
Downloading 76 bytes @ address 0x4002C858 - Verified OK
Downloading 176 bytes @ address 0x4002C8A4 - Verified OK
Downloading 968 bytes @ address 0x4002C954 - Verified OK
Downloading 360 bytes @ address 0x4002CD1C - Verified OK
Downloading 108 bytes @ address 0x4002CE84 - Verified OK
Downloading 320 bytes @ address 0x4002CEF0 - Verified OK
Downloading 300 bytes @ address 0x4002D030 - Verified OK
Downloading 508 bytes @ address 0x4002D15C - Verified OK
Downloading 628 bytes @ address 0x4002D358 - Verified OK
Downloading 60 bytes @ address 0x4002D5CC - Verified OK
Downloading 164 bytes @ address 0x4002D608 - Verified OK
Downloading 428 bytes @ address 0x4002D6AC - Verified OK
Downloading 148 bytes @ address 0x4002D858 - Verified OK
Downloading 208 bytes @ address 0x4002D8EC - Verified OK
Downloading 208 bytes @ address 0x4002D9BC - Verified OK
Downloading 628 bytes @ address 0x4002DA8C - Verified OK
Downloading 232 bytes @ address 0x4002DD00 - Verified OK
Downloading 1408 bytes @ address 0x40030000 - Verified OK
Writing register (PC = 0x70e00040)
Read 4 bytes @ address 0x4000E070 (Data = 0xE59F1034)
Read 4 bytes @ address 0x40020D98 (Data = 0xE59F3284)
Read 4 bytes @ address 0x40020F50 (Data = 0xE24B3010)
Read 4 bytes @ address 0x40020D98 (Data = 0xE59F3284)
Read 4 bytes @ address 0x40020FE8 (Data = 0xE24B300A)
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Read 4 bytes @ address 0x40020D98 (Data = 0xE59F3284)
Read 4 bytes @ address 0x40020E6C (Data = 0xEBFFFF29)
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Reading all registers
Setting breakpoint @ address 0x40020E6C, Size = 4, BPHandle = 0x0001
Setting breakpoint @ address 0x40020F50, Size = 4, BPHandle = 0x0002
Setting breakpoint @ address 0x40020FE8, Size = 4, BPHandle = 0x0003
Setting breakpoint @ address 0x4002113C, Size = 4, BPHandle = 0x0004
Starting target CPU...
Reading all registers
Removing breakpoint @ address 0x40020E6C, Size = 4
Removing breakpoint @ address 0x40020F50, Size = 4
Removing breakpoint @ address 0x40020FE8, Size = 4
Removing breakpoint @ address 0x4002113C, Size = 4
Read 4 bytes @ address 0x4002113C (Data = 0xE3A03000)
Reading 64 bytes @ address 0x10001FC0
Reading 112 bytes @ address 0x4002113C
Read 4 bytes @ address 0x40030860 (Data = 0x00000000)
Read 1 bytes @ address 0x40020D88 (Data = 0x00)
Read 1 bytes @ address 0x40020D88 (Data = 0x00)
Read 4 bytes @ address 0x40021068 (Data = 0xE3A03000)
Read 4 bytes @ address 0x40021090 (Data = 0xE51B3008)
Setting breakpoint @ address 0x40020E6C, Size = 4, BPHandle = 0x0005
Setting breakpoint @ address 0x40020F50, Size = 4, BPHandle = 0x0006
Setting breakpoint @ address 0x40020FE8, Size = 4, BPHandle = 0x0007
Setting breakpoint @ address 0x40021090, Size = 4, BPHandle = 0x0008
Starting target CPU...
ERROR: Bad JTAG communication: Write to IR: Expected 0x1, got 0x0 (TAP Command : 2) @ Off 0x5.

0 Likes
3 Replies
Anonymous
Not applicable

Device is expected to be in bootloader mode to use JTAG. As you suspected that there can be some hardware problem, can you once check on FX3 rev 3 kit if you have. The debugging functionality is similar for both parts. IF you are not seeing the issue on FX3 DVK, then the problem might be with the hardware. 

0 Likes

Hello!

I have the same issue.

I have switched BOOT mode to USB - the result is the same.

0 Likes

The same situation on your DVK

0 Likes