Forums - Flash CDB20(QCA4020) hang with "Starting target CPU..."

2 posts / 0 new
Last post
Flash CDB20(QCA4020) hang with "Starting target CPU..."
junqiang.shi
Join Date: 3 Feb 20
Posts: 2
Posted: Mon, 2020-02-03 06:48
Hi all,
 
I tried to flash QCA4020 with J-Link, but every time stuck at same place
 
Command line Log
D:\projects\qca4020-or-3-1_qca_oem_sdk-cdb.git\target\quartz\demo\QCLI_demo\build\gcc>flash.bat
Could Not Find D:\projects\qca4020-or-3-1_qca_oem_sdk-cdb.git\target\quartz\demo\QCLI_demo\build\gcc\output\firmware_table.bin
Could Not Find D:\projects\qca4020-or-3-1_qca_oem_sdk-cdb.git\target\quartz\demo\QCLI_demo\build\gcc\output\generated_partition_table.xml
Could Not Find D:\projects\qca4020-or-3-1_qca_oem_sdk-cdb.git\target\quartz\demo\QCLI_demo\build\gcc\output\generated_fwd_table.xml
[2020-02-03 09:28:01,513] INFO: Checking for files to add to the image for Firmware Descriptor Table 0 File:gen_fwd_table.py:673 Function:gen_xml_program
[2020-02-03 09:28:01,513] INFO: Done Generating XML file to program. File:gen_fwd_table.py:711 Function:gen_xml_program
Starting GDB Server....
 
GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 7.12.1.20170417-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word".
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x000154e2 in ?? ()
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x5d4 lma 0x10080000
Start address 0x100462c2, load size 24864
Transfer rate: 54 KB/sec, 8288 bytes/write.
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.1.r2-00004-QZHW-2_20190923_201556/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.
 
JlinkGDBServerCL Log
 
 
SEGGER J-Link GDB Server V6.62 Command Line Version
 
JLinkARM.dll V6.62 (DLL compiled Jan 24 2020 16:32:09)
 
Command line: -select USB -device Cortex-M4 -endian little -if JTAG -speed 1000 -noir -nolocalhostonly -port 2331
-----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:                 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 ARM / Flasher ARM V4 compiled Jan  6 2020 11:24:13
Hardware: V4.02
S/N: 164211093
Feature(s): JFlash, 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...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x000154E2 (Data = 0x03092000)
Read 2 bytes @ address 0x000154E2 (Data = 0x2000)
Downloading 16224 bytes @ address 0x10046000
Downloading 7148 bytes @ address 0x10049F60
Downloading 1492 bytes @ address 0x10080000
Writing register (PC = 0x100462c2)
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Read 2 bytes @ address 0x100462C2 (Data = 0x489A)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Writing register (SP = 0x100815d4)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Downloading 4 bytes @ address 0xE000ED94
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Downloading 4 bytes @ address 0x44000008
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6800489A)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Read 2 bytes @ address 0x10046146 (Data = 0xE92D)
Read 2 bytes @ address 0x10046148 (Data = 0x41F0)
Read 2 bytes @ address 0x1004614A (Data = 0x4E93)
Read 4 bytes @ address 0x1004639A (Data = 0x65D31008)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Read 2 bytes @ address 0x10046146 (Data = 0xE92D)
Read 2 bytes @ address 0x10046148 (Data = 0x41F0)
Read 2 bytes @ address 0x1004614A (Data = 0x4E93)
Read 4 bytes @ address 0x1004639A (Data = 0x65D31008)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Setting breakpoint @ address 0x1004614C, Size = 2, BPHandle = 0x0001
Starting target CPU...
 
All related software version as folloing
 
JLink:      V6.62
 
Python: 2.7.17
 
QCA4020 SDK: qca4020-or-3-1_qca_oem_sdk-cdb
 
Flash the QCA4020 by OpenOCD is OK, just can not succeed by using JLink, My Jlink connection is following this link https://developer.qualcomm.com/forum/qdn-forums/hardware/qca4020-qca4024...
 
From JLink log, we can see
J-Link found 2 JTAG devices, Total IRLen = 15
 
 
That means Jlink connection is ok, right?
 
But every time, Jlink side just hang at "Starting target CPU...", no more command can send to JLink
 
In folder ./gdbout, there one file gdb.commands.txt created with following commands:
 
target remote localhost:2331
load ../../../../../build/tools/flash/JTAGPROGRAMMER_IMG_ARNTRI.elf
file ../../../../../build/tools/flash/JTAGPROGRAMMER_IMG_ARNTRI.elf
set $pc = jstorage_init
set $sp = &jstorage_stack[sizeof(jstorage_stack)]
set {int}0xE000ED94 = 0
set {int}0x44000008 = 0
break main_c
continue
echo "WRITE ./firmware_table.bin, offset=0 start_sector=0 num_sectors=1"
set device_type = MEM_DEVICE_SPINOR
set jtag_prog_param.cmd_status = 10
set jtag_prog_param.addr = 0
set jtag_prog_param.data_length = 1
restore ./firmware_table.bin binary jtag_prog_param.data-0 0 4096
continue
append binary memory gdbout/jtagprogrammer.log output_buffer &output_buffer[output_buffer_length+1]
set output_buffer_length = 0
dump binary value gdbout/command_result.log jtag_prog_param.cmd_status
 
I tried to one by one to execute these commands, but after command "break main_c", if I execute "continue", Jlink will hang with "Starting target CPU..."
 
 
D:\projects\qca4020-or-3-1_qca_oem_sdk-cdb.git\target\quartz\demo\QCLI_demo\build\gcc>arm-none-eabi-gdb.exe
GNU gdb (GNU Tools for ARM Embedded Processors 6-2017-q2-update) 7.12.1.20170417-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x000154f0 in ?? ()
(gdb) load ../../../../../build/tools/flash/JTAGPROGRAMMER_IMG_ARNTRI.elf
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x5d4 lma 0x10080000
Start address 0x100462c2, load size 24864
Transfer rate: 240 KB/sec, 8288 bytes/write.
(gdb) file ../../../../../build/tools/flash/JTAGPROGRAMMER_IMG_ARNTRI.elf
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from ../../../../../build/tools/flash/JTAGPROGRAMMER_IMG_ARNTRI.elf...done.
(gdb) set $pc = jstorage_init
(gdb) set $sp = &jstorage_stack[sizeof(jstorage_stack)]
(gdb) set {int}0xE000ED94 = 0
(gdb) set {int}0x44000008 = 0
(gdb) break main_c
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.1.r2-00004-QZHW-2_20190923_201556/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.
(gdb) continue
Continuing.
 
 
Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x000154F0 (Data = 0x0F01F011)
Read 2 bytes @ address 0x000154F0 (Data = 0xF011)
Downloading 16224 bytes @ address 0x10046000
Downloading 7148 bytes @ address 0x10049F60
Downloading 1492 bytes @ address 0x10080000
Writing register (PC = 0x100462c2)
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Read 2 bytes @ address 0x100462C2 (Data = 0x489A)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Writing register (SP = 0x100815d4)
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Downloading 4 bytes @ address 0xE000ED94
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Downloading 4 bytes @ address 0x44000008
Reading all registers
Read 4 bytes @ address 0x100462C2 (Data = 0x6801489A)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Read 2 bytes @ address 0x10046146 (Data = 0xE92D)
Read 2 bytes @ address 0x10046148 (Data = 0x41F0)
Read 2 bytes @ address 0x1004614A (Data = 0x4E93)
Read 4 bytes @ address 0x1004639A (Data = 0x65D31008)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Read 2 bytes @ address 0x10046146 (Data = 0xE92D)
Read 2 bytes @ address 0x10046148 (Data = 0x41F0)
Read 2 bytes @ address 0x1004614A (Data = 0x4E93)
Read 4 bytes @ address 0x1004639A (Data = 0x65D31008)
Read 2 bytes @ address 0x1004614C (Data = 0xF04F)
Setting breakpoint @ address 0x1004614C, Size = 2, BPHandle = 0x0002
Starting target CPU...
 
  • Up0
  • Down0
junqiang.shi
Join Date: 3 Feb 20
Posts: 2
Posted: Mon, 2020-02-03 08:45

I found the problem, it is issue of JLink hardware, replace with other JLink hardware, no problem found

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