Forums - Error using JTAG Debugging

5 posts / 0 new
Last post
Error using JTAG Debugging
Foong
Join Date: 30 Aug 18
Posts: 15
Posted: Thu, 2018-11-08 18:26

Hi,

I am trying to use OpenOCD to perform JTAG debugging through Eclipse. I have followed the documentation "QCA402x (CDB2x) Development Kit User Guide" to disable deep-sleep, as well as setup the OpenOCD on Eclipse. However, it shows the following error. Could you please advice on how should I proceed? Thank you in advance.

Open On-Chip Debugger 0.10.0 (2017-06-09) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 5000 kHz
Info : clock speed 5000 kHz
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 11 -expected-id 0x300160e1"
Info : QM4.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000001c0 msp: 0x10000154
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* QM4.cpu            cortex_m   little QM4.cpu            halted
Started by GNU MCU Eclipse
Info : accepting 'gdb' connection on tcp/3333
semihosting is enabled
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000001c0 msp: 0x10000154, semihosting
Info : dropped 'gdb' connection (error -400)
Info : accepting 'gdb' connection on tcp/3333
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00007106 msp: 0x10032ba0, semihosting
invalid command name "speed"
invalid command name "endian"
invalid command name "jtagconf"
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
===== arm v7m registers
(0) r0 (/32): 0x00000140
(1) r1 (/32): 0x00000000
(2) r2 (/32): 0xFFE69E5C
(3) r3 (/32): 0xFFFFFFFF
(4) r4 (/32): 0xFFE69E8B
(5) r5 (/32): 0x44001000
(6) r6 (/32): 0x00000000
(7) r7 (/32): 0x03000000
(8) r8 (/32): 0x10032D68
(9) r9 (/32): 0xE000E000
(10) r10 (/32): 0x000186A0
(11) r11 (/32): 0x00000000
(12) r12 (/32): 0xFFFFFFFF
(13) sp (/32): 0x10032BA0
(14) lr (/32): 0x00007105
(15) pc (/32): 0x00007106
(16) xPSR (/32): 0x81000000
(17) msp (/32): 0x10032BA0
(18) psp (/32): 0x00000000
(19) primask (/1): 0x01
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
(23) d0 (/64): 0x0000000000000000
(24) d1 (/64): 0x0000000000000000
(25) d2 (/64): 0x0000000000000000
(26) d3 (/64): 0x0000000000000000
(27) d4 (/64): 0x0000000000000000
(28) d5 (/64): 0x0000000000000000
(29) d6 (/64): 0x0000000000000000
(30) d7 (/64): 0x0000000000000000
(31) d8 (/64): 0x0000000000000000
(32) d9 (/64): 0x0000000000000000
(33) d10 (/64): 0x0000000000000000
(34) d11 (/64): 0x0000000000000000
(35) d12 (/64): 0x0000000000000000
(36) d13 (/64): 0x0000000000000000
(37) d14 (/64): 0x0000000000000000
(38) d15 (/64): 0x0000000000000000
(39) fpscr (/32): 0x00000000
===== Cortex-M DWT registers
(40) dwt_ctrl (/32)
(41) dwt_cyccnt (/32)
(42) dwt_0_comp (/32)
(43) dwt_0_mask (/4)
(44) dwt_0_function (/32)
(45) dwt_1_comp (/32)
(46) dwt_1_mask (/4)
(47) dwt_1_function (/32)
(48) dwt_2_comp (/32)
(49) dwt_2_mask (/4)
(50) dwt_2_function (/32)
(51) dwt_3_comp (/32)
(52) dwt_3_mask (/4)
(53) dwt_3_function (/32)
 
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2018-11-12 15:27

kindly check the jumper settings and try resetting the device to verify JTAG connection.

Make sure the JTAG debugging is working on Windows.
Instructions are available in section "3.7.2.2 Debugging through GDB" of document "QCA402x (CDB2x) Development Kit User Guide".

  • Up0
  • Down0
Foong
Join Date: 30 Aug 18
Posts: 15
Posted: Tue, 2018-11-13 02:14

Hi Raja,

I have followed section "3.7.2.2 Debugging through GDB" of document "QCA402x (CDB2x) Development Kit User Guide", the JTAG debug through commandline interface is working.

However, when I tried using Eclipse to perform JTAG debugging, it failed with the error above. Following are the steps that I have performed for using Eclipse JTAG debugging:

  1. Disable deep sleep as shown in section 3.7.2 of document "QCA402x (CDB2x) Development Kit User Guide".
  2. Setup Eclipse JTAG debugging exactly the same as shown in section "3.7.2.3 Debugging through Eclipse".
  3. Compiled the project.
  4. Flashed the project onto QCA4020 evaluation kit using JTAG (It shows that JTAG is working fine).
  5. Reset the board after flashing successful.
  6. Go to Run > Debug Configuration, and click Debug.

After step 6, Eclipse switched to Debug perspective, and the console showed the following logs:

Open On-Chip Debugger 0.10.0 (2017-06-09) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 5000 kHz
Info : clock speed 5000 kHz
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 11 -expected-id 0x300160e1"
Info : QM4.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000001c0 msp: 0x10000154
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* QM4.cpu            cortex_m   little QM4.cpu            halted
Started by GNU MCU Eclipse
Info : accepting 'gdb' connection on tcp/3333
semihosting is enabled
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x000001c0 msp: 0x10000154, semihosting
Info : dropped 'gdb' connection (error -400)
Info : accepting 'gdb' connection on tcp/3333
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Info : JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
Info : JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
Warn : Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread 
xPSR: 0x81000000 pc: 0x00007106 msp: 0x10032ba0, semihosting
invalid command name "speed"
invalid command name "endian"
invalid command name "jtagconf"
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3d2
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b45e
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0105b3ce
===== arm v7m registers
(0) r0 (/32): 0x00000140
(1) r1 (/32): 0x00000000
(2) r2 (/32): 0xFFE69E5C
(3) r3 (/32): 0xFFFFFFFF
(4) r4 (/32): 0xFFE69E8B
(5) r5 (/32): 0x44001000
(6) r6 (/32): 0x00000000
(7) r7 (/32): 0x03000000
(8) r8 (/32): 0x10032D68
(9) r9 (/32): 0xE000E000
(10) r10 (/32): 0x000186A0
(11) r11 (/32): 0x00000000
(12) r12 (/32): 0xFFFFFFFF
(13) sp (/32): 0x10032BA0
(14) lr (/32): 0x00007105
(15) pc (/32): 0x00007106
(16) xPSR (/32): 0x81000000
(17) msp (/32): 0x10032BA0
(18) psp (/32): 0x00000000
(19) primask (/1): 0x01
(20) basepri (/8): 0x00
(21) faultmask (/1): 0x00
(22) control (/2): 0x00
(23) d0 (/64): 0x0000000000000000
(24) d1 (/64): 0x0000000000000000
(25) d2 (/64): 0x0000000000000000
(26) d3 (/64): 0x0000000000000000
(27) d4 (/64): 0x0000000000000000
(28) d5 (/64): 0x0000000000000000
(29) d6 (/64): 0x0000000000000000
(30) d7 (/64): 0x0000000000000000
(31) d8 (/64): 0x0000000000000000
(32) d9 (/64): 0x0000000000000000
(33) d10 (/64): 0x0000000000000000
(34) d11 (/64): 0x0000000000000000
(35) d12 (/64): 0x0000000000000000
(36) d13 (/64): 0x0000000000000000
(37) d14 (/64): 0x0000000000000000
(38) d15 (/64): 0x0000000000000000
(39) fpscr (/32): 0x00000000
===== Cortex-M DWT registers
(40) dwt_ctrl (/32)
(41) dwt_cyccnt (/32)
(42) dwt_0_comp (/32)
(43) dwt_0_mask (/4)
(44) dwt_0_function (/32)
(45) dwt_1_comp (/32)
(46) dwt_1_mask (/4)
(47) dwt_1_function (/32)
(48) dwt_2_comp (/32)
(49) dwt_2_mask (/4)
(50) dwt_2_function (/32)
(51) dwt_3_comp (/32)
(52) dwt_3_mask (/4)
(53) dwt_3_function (/32)
Please advise if any step is missed out or done wrongly. Thank you for your help.
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2018-11-13 17:29

I have tried internally to verfiy the issue and seen similar issue "Failed to read memory " while using in
However the error reported is observed in case of wrong loading of elf file.

Could you kindly after flashing through JTAG, were you able to autoboot the device and verify the serial connection?
Could you confirm the Debug Configurations are accurate and Main->C/C++ Application is using "Quartz.elf" file
and Startup-> Run/Restart Commands is set as "source v2/quartcdb.gdbinit" and set breakpoint at "app_start" and continue are checked ?

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2018-11-13 17:30

I have tried internally to verfiy the issue and seen similar issue "Failed to read memory " while using wrong elf file.

Could you kindly after flashing through JTAG, were you able to autoboot the device and verify the serial connection?
Could you confirm the Debug Configurations are accurate and Main->C/C++ Application is using "Quartz.elf" file
and Startup-> Run/Restart Commands is set as "source v2/quartcdb.gdbinit" and set breakpoint at "app_start" and continue are checked ?

  • 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.