Forums - J-Link Debugging

10 posts / 0 new
Last post
J-Link Debugging
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Fri, 2019-11-08 05:19

Hi,

does anyone have instructions on how to set-up Eclipse for J-Link debugging? Especially the support to flash the image is needed. I found some batch files in the SDK that at least seem to support a J-Link setup, but currently it does not work for me.

Thanks and best regards

Andreas

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2019-11-11 18:40
Below jumper connections are required to configure for J-Link debugging:
 
QCA4020 J37-pin3 to JLink Pin9  (JTAG TCK)
QCA4020 J38-pin3 to JLink Pin13 (JTAG TDI)
QCA4020 J40-pin3 to JLink Pin7  (JTAG TMS)
QCA4020 J39-pin3 to JLink Pin5  (JTAG TDO)
QCA4020 J1 -pin4 to JLink Pin1  (VREF)
QCA4020 J33-pin1 to JLink Pin3  (TRST)
JTAG GPIO bootstrap: (Insert Jumper J30 Pin1-2 and jumper at J31 1-2 for JTAG debug mode)
 
 
Execute "debug.bat m4" command to start debugging using J-Link.
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2019-11-11 18:41

*QCA4020 J33-pin1 to JLink Pin3  (TRST)

Kindly note QCA4020 J33-pin1 should be connected to J-Link Pin3 (TRST)

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Tue, 2019-11-12 07:24

Thanks for the setup information. I can confirm that I did that already correctly. If I follow your advice the batch file complains about this file, which I can not find somewhere in the SDK: Quartz.JLinkScript

I had some progress with this topic. I am now able to download the SW via J-Link with the corresponding batch file. When debugging I can also connect to the board, but I can not run the SW correctly from the debugger. It stays always in this part of the code:

sbl1_main_ctl() at sbl1_mc.c:355 0x100a05be    


If I let the board run freely and attach to the board with J-Link while running, I am able to pause the execution, set a breakpoint and debug. Currently the main issue seems to be the start-up phase, when the board waits for the JTAG connection and then the boot-loader phase is being executed. I guess maybe the ELF file has not been loaded or something similar?

Thanks Andreas

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Thu, 2019-11-21 06:09

No one out there who has this running?

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-11-21 12:56
sbl1_main_ctl() is the Main Controller which calls MissionROM, stack canary init, Configure, authenticate XIP and Transfer execution to SBL_XIP.
 
In my case I tried to use default QCLI_demo with sleep disable for JTAG and could observe as below on Console prompt:
 
$ debug.bat m4
***************
Breakpoint 2 at 0x100a0132: file /local/mnt/....ioesw_proc/core/boot/sbl//sbl1_mc.c, line 345.
Breakpoint 3 at 0x10fbc: file /local/mnt/....ioesw_proc/core/v2/rom/drivers/debugtools/err/src/apps_proc/arm//err_jettison_core_m4.s, line 83.
(gdb) b app_init
Breakpoint 4 at 0x10047170: file ..\..\src\qcli\pal.c, line 457.
(gdb) b app_start
Breakpoint 5 at 0x10047238: file ..\..\src\qcli\pal.c, line 496.
(gdb) b enable_wlan
Breakpoint 6 at 0x10048000: file ..\..\src\wifi\wifi_cmd_handler.c, line 379.
(gdb) c
Continuing.
 
Breakpoint 4, app_init (ColdBoot=0x1) at ..\..\src\qcli\pal.c:457
457     {
(gdb) c
Continuing.
 
Breakpoint 5, app_start (ColdBoot=0x1) at ..\..\src\qcli\pal.c:496
496     {
(gdb) c
Continuing.
 
Breakpoint 6, enable_wlan () at ..\..\src\wifi\wifi_cmd_handler.c:379
379     {
(gdb)

Can you try to delete breakpoint 2 which is "sbl1_main_ctl" and confirm if its still an issue after bootup ?
  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Mon, 2019-11-25 02:11

Hi,

as mentioned above, when executing: debug.bat m4

it complains that the the J-Link script file:    Quartz.JLinkScript   can not be found.

I can not find it anywhere in the SDK. What is the content of this file and how is the J-Link  configured?

Thanks, Andreas

  • Up0
  • Down0
andreas
Join Date: 21 Oct 19
Posts: 34
Posted: Thu, 2020-01-23 05:01

It is now months ago since I asked to get the missing file.

I kindly renew my request: Is it possible to share the Quartz.JLinkScript file with this community? It is referenced by the debug.bat file and seems not to be part of the SDK. I would like to understand, how JLink need to be configured to make it work.

Thanks and best regards

Andreas

  • Up0
  • Down0
andrew_2
Join Date: 24 Jul 20
Posts: 1
Posted: Thu, 2020-08-06 12:11

Hi,

I'm currently attempting to debug through the Eclipse IDE with a J-Link and having a similar issue. If the device is freely running, I can pause the execution and debug, but having issue in the start-up phase. Has there been a solution?

Thanks!

Andrew

  • Up0
  • Down0
hossamf
Join Date: 24 Nov 20
Posts: 4
Posted: Sun, 2021-09-05 10:59

I have QCA4020 M20 module  mounted on a custom board.  I am able to flash "hello World" image to the M20 module using the USB and  python script to flash to the M20 using Emergency Download Mode (EDL).

I do not have openOCD on this board. Just the QCA42020 M20 mounted on this custom board and both USB and JTAG interfaces are exposed in addition to the many GPIOs of the QCA4020 M20 module.

I need to flash using the JTAG interface. I am using Eclipse IDE and J-link debugger. I configured the IDE and it seems connected to the Target but can not proceed after it and download the image to the M20 and saying ""Waiting for GDB connection"

What I am missing after that? can you please help points to exact instructions I shall use to flash using JTAG on the QCA4020 M20 module?
below are screen shoot of Debug configuration in Eclipse and ouptut from J-link GDB Server?

 SEGGER J-Link GDB Server V6.92 GUI Version

 
JLinkARM.dll V6.92 (DLL compiled Dec 18 2020 13:12:28)
 
-----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:                 Cortex-M4
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little
 
Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V11 compiled Feb  4 2021 12:59:17
Hardware: V11.00
S/N: 51013946
Feature(s): GDB
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...
 
J-Link found 2 JTAG devices, Total IRLen = 15
JTAG ID: 0x4BA00477 (Cortex-M4)
Connected to target
Waiting for GDB connection...
 
 
 

Thanks a lot

 

 

 

 

 

 

 

 

 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.