Forums - Debugger issues with QCLI_power_demo and hello_world demo

9 posts / 0 new
Last post
Debugger issues with QCLI_power_demo and hello_world demo
vh
Join Date: 3 Sep 18
Posts: 5
Posted: Wed, 2018-10-24 07:49

Hi all,

I'm currently trying to get the QCLI_power_demo to work on the QCA4020 development kit (CDB20, Rev B). After I've set up OpenOCD and Eclipse, I flashed the demo from the quartz/demo folder from the QCA4020.OR.2.0_00048 SDK and connected to the board via serial with the baud rate 115200, 8 bits per character, no parity or flow control and one stop bit as specified in the Development kit user guide. However, all i got was a blank screen and no QCLI interface. After this, I tried to flash the Hello_world demo to see if my build environment is correctly set-up and the demo flashed successfully. A quick look at the serial connection verified that the QCA4020 was indeed printing Hello world continously. Knowing that the board had successfully flashed, I tried to setup a debug session via OpenOCD so that I could see what was going on. I have setup Eclipse as specified in the user guide. After some troubleshooting I have found that OpenOCD runs, and GDB can connect to OpenOCD, but some commands in the quartzcdb.gdbinit file are not executed (like monitor speed auto and monitor endian little).

Running a debug session in Eclipse with gdb hardware debugging gets me to the point where the cookie in the Second Boot Loader( SBL) is set, which is the last line of the gdbinit file. The issue there is that I am not able to set the breakpoint on app start, as seen in the following error message from gdb:

(gdb) continue  

Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x104e7ee

 

 My developing environment consists of:
Ubuntu 18.04LTS x64
 

Open On-Chip Debugger 0.10.0+dev-00546-g1afec4f5 (2018-10-02-12:05)
 

arm-none-eabi gcc version 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] (GNU Tools for Arm Embedded Processors 7-2018-q2-update)
 

GNU gdb (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 8.1.0.20180315-git 
 

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.2, mixed mode)

 

Eclipse IDE for C/C++ Developers
Version: Photon Release (4.8.0)

 

 

Is there anything that i could possibly have overlooked? Flashing a demo works via OpenOCD just fine, only debugging is causing issues. 
 

 

It might be worth mentioning that I did change the flash_openocd.sh and qca402x_openocd.cfg config files because the default configuration did not work for me. In flash_openocd.sh I needed to change the GDB_PATH to my local arm-none-eabi location path and in qca402x_openocd.cfg did the following statement: target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME cause OpenOCD to not recognize the the target, so I changed that line to:

dap create qcatarget -chain-position $_TARGETNAME
target create $_TARGETNAME cortex_m -dap qcatarget
 
I hope you could help my solving this problem.
 
Thank you in advance.
 
 
 

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2018-10-25 12:21

Kindly confirm that you have disabled deepsleep to allow boot via JTAG.
Refer to section "3.7.2 JTAG debug mode" from document QCA402x (CDB2x) Development Kit User Guide 80-YA121-140 for instructions.

  • Up0
  • Down0
vh
Join Date: 3 Sep 18
Posts: 5
Posted: Fri, 2018-10-26 02:11

Hi Raja,

I did indeed disable the sleep driver as specified on paragraph 3.7.2. in the user guide. In target/quartz/demo/Helloworld_demo/src/export/DevCfg_master_devcfg_out_cdb.xml , the value:  <props id="0x2" oem_configurable="false" type="0x00000002"> 1 < /props> was changed to  <props id="0x2" oem_configurable="false" type="0x00000002"> 0 < /props>.

After that, I rebuild the project and flashed it. The problem however, still persists after disabling deep-sleep mode.

 

 
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Fri, 2018-10-26 14:23

Can you manually try to verfiy if the JTAG debugging is working.

Manual steps:
> Navigate to /build/gcc folder and run " openocd -f qca402x_openocd.cfg"
> Open new terminal and navigate to /build/gcc folder and run "arm-none-eabi-gdb -x /v2/quartzcdb.gdbinit"
> you should be able to verify the JTAG is workinf, if not there is an issue with the board setup or openocd/arm toolchain version.

In case of failue Kindly provide the output from serial console of above command including "openocd --version"

  • Up0
  • Down0
vh
Join Date: 3 Sep 18
Posts: 5
Posted: Mon, 2018-10-29 08:44
Hi Raja,
The output that I get differs from the output generated by Eclipse.
I can start a OpenOCD instance and connect to the session using the quartzcdb.gdbinit file. However, I get a lot of errors about the loadable sections as show in the output. Within GDB, some commands do work such as monitor halt and start work but other commands such as monitor endian, monitor jtagconf, or monitor endian little are not found. I can set a breakpoint but when I invoke the continue command, I get errors and the breakpoint can't be added.
 
 
The OpenOCD console output:
user:~/Downloads/QCA4020.OR.2.0_00048/target/quartz/demo/Helloworld_demo/build/gcc$ openocd -f qca402x_openocd.cfg 
Open On-Chip Debugger 0.10.0+dev-00546-g1afec4f5 (2018-10-02-12:05)
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 : Listening on port 3333 for gdb connections
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
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
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: 0x000070fa msp: 0x10032ba0
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0104e7c4
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0104e7ee
Error: JTAG-DP STICKY ERROR
Error: Failed to read memory at 0x0104e7ee
Error: can't add breakpoint: unknown reason
shutdown command invoked
 
 
 
The output which the GDB console prints:
user:~/Downloads/QCA4020.OR.2.0_00048/target/quartz/demo/Helloworld_demo/build/gcc$ arm-none-eabi-gdb -x v2/quartzcdb.gdbinit 
GNU gdb (GNU Tools for Arm Embedded Processors 7-2018-q2-update) 8.1.0.20180315-git
Copyright (C) 2018 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=x86_64-linux-gnu --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.
0x000001c0 in ?? ()
JTAG tap: QM4.cpu tap/device found: 0x4ba00477 (mfg: 0x23b (ARM Ltd.), part: 0xba00, ver: 0x4)
JTAG tap: auto0.tap tap/device found: 0x300160e1 (mfg: 0x070 (Qualcomm), part: 0x0016, ver: 0x3)
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: 0x000070fa msp: 0x10032ba0
add symbol table from file "../../../../../bin/cortex-m4/IOE_ROM_IPT_IMG_ARNNRI_patched_syms.elf" at
.text_addr = 0x10000
warning: section .text not found in /home/user/Downloads/QCA4020.OR.2.0_00048/target/bin/cortex-m4/IOE_ROM_IPT_IMG_ARNNRI_patched_syms.elf
warning: Loadable section "sockcall__i.t_errno" outside of ELF segments
warning: Loadable section "sockcall__i.t_getname" outside of ELF segments
warning: Loadable section "sockcall__i.t_getpeername" outside of ELF segments
warning: Loadable section "sockcall__i.t_getsockname" outside of ELF segments
warning: Loadable section "sockcall__i.t_getsockopt" outside of ELF segments
warning: Loadable section "sockcall__i.t_listen" outside of ELF segments
warning: Loadable section "sockcall__i.t_recv" outside of ELF segments
warning: Loadable section "sockcall__i.t_recvfrom" outside of ELF segments
warning: Loadable section "soselect__i.t_select" outside of ELF segments
warning: Loadable section "sockcall__i.t_send" outside of ELF segments
warning: Loadable section "sockcall__i.t_sendto" outside of ELF segments
warning: Loadable section "sockcall__i.t_setsockopt" outside of ELF segments
warning: Loadable section "sockcall__i.t_shutdown" outside of ELF segments
warning: Loadable section "sockcall__i.t_socket" outside of ELF segments
warning: Loadable section "sockcall__i.t_socketclose" outside of ELF segments
warning: Loadable section "tcp6__i.tcp6_rcv" outside of ELF segments
warning: Loadable section "tcp6__i.tcp6_send" outside of ELF segments
warning: Loadable section "tcp_usr__i.tcp_attach" outside of ELF segments
warning: Loadable section "tcp_timr__i.tcp_canceltimers" outside of ELF segments
warning: Loadable section "tcpcksum__i.tcp_cksum" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_close" outside of ELF segments
warning: Loadable section "tcp_zio__i.tcp_data_upcall" outside of ELF segments
warning: Loadable section "tcp_usr__i.tcp_disconnect" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_dooptions" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_drop" outside of ELF segments
warning: Loadable section "tcp_timr__i.tcp_fasttimo" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_findbuf" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_freeassmq" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_getseq" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_init" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_input" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_mss" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_newtcpcb" outside of ELF segments
warning: Loadable section "soselect__i.tcp_notify" outside of ELF segments
warning: Loadable section "tcp_out__i.tcp_output" outside of ELF segments
warning: Loadable section "tcp_zio__i.tcp_pktalloc" outside of ELF segments
warning: Loadable section "tcp_zio__i.tcp_pktfree" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_pulloutofband" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_putseq" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_quench" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_reass" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_respond" outside of ELF segments
warning: Loadable section "tcp_out__i.tcp_setpersist" outside of ELF segments
warning: Loadable section "osporttk__i.tcp_sleep" outside of ELF segments
warning: Loadable section "tcp_timr__i.tcp_slowtimo" outside of ELF segments
warning: Loadable section "tcp_subr__i.tcp_template" outside of ELF segments
warning: Loadable section "nptcp__i.tcp_tick" outside of ELF segments
warning: Loadable section "tcp_timr__i.tcp_timers" outside of ELF segments
warning: Loadable section "tcp_usr__i.tcp_usrclosed" outside of ELF segments
warning: Loadable section "tcp_usr__i.tcp_usrreq" outside of ELF segments
warning: Loadable section "osporttk__i.tcp_wakeup" outside of ELF segments
warning: Loadable section "tcp_in__i.tcp_xmit_timer" outside of ELF segments
warning: Loadable section "tcp_zio__i.tcp_xout" outside of ELF segments
warning: Loadable section "tcpport__i.tcpinit" outside of ELF segments
warning: Loadable section "ssl_cert__i.timeCompare" outside of ELF segments
warning: Loadable section "osporttk__i.tk_del" outside of ELF segments
warning: Loadable section "osporttk__i.tk_event_clear" outside of ELF segments
warning: Loadable section "osporttk__i.tk_event_create" outside of ELF segments
warning: Loadable section "osporttk__i.tk_event_delete" outside of ELF segments
warning: Loadable section "osporttk__i.tk_event_set" outside of ELF segments
warning: Loadable section "osporttk__i.tk_event_wait" outside of ELF segments
warning: Loadable section "osporttk__i.tk_get_ticks" outside of ELF segments
warning: Loadable section "osporttk__i.tk_init_os" outside of ELF segments
warning: Loadable section "osporttk__i.tk_msec_delay" outside of ELF segments
warning: Loadable section "osporttk__i.tk_mutex_create" outside of ELF segments
warning: Loadable section "osporttk__i.tk_mutex_free" outside of ELF segments
warning: Loadable section "osporttk__i.tk_mutex_pend" outside of ELF segments
warning: Loadable section "osporttk__i.tk_mutex_post" outside of ELF segments
warning: Loadable section "netmain_mod__i.tk_netmain" outside of ELF segments
warning: Loadable section "nettick__i.tk_nettick" outside of ELF segments
warning: Loadable section "osporttk__i.tk_new" outside of ELF segments
warning: Loadable section "osporttk__i.tk_res_lock" outside of ELF segments
warning: Loadable section "osporttk__i.tk_res_unlock" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sem_create" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sem_free" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sem_pend" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sem_post" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sem_post_isr" outside of ELF segments
warning: Loadable section "osporttk__i.tk_sleep" outside of ELF segments
warning: Loadable section "osporttk__i.tk_stats" outside of ELF segments
warning: Loadable section "osporttk__i.tk_suspend" outside of ELF segments
warning: Loadable section "osporttk__i.tk_wake" outside of ELF segments
warning: Loadable section "osporttk__i.tk_yield" outside of ELF segments
warning: Loadable section "uart_os__i.uart_clock_close" outside of ELF segments
warning: Loadable section "uart_os__i.uart_clock_open" outside of ELF segments
warning: Loadable section "uart__i.uart_close" outside of ELF segments
warning: Loadable section "uart__i.uart_dsr_cb" outside of ELF segments
warning: Loadable section "uart_os__i.uart_get_properties" outside of ELF segments
warning: Loadable section "uart_os__i.uart_issue_power_votes" outside of ELF segments
warning: Loadable section "uart_os__i.uart_mem_bank_issue_vote" outside of ELF segments
warning: Loadable section "uart_os__i.uart_mem_bank_release_vote" outside of ELF segments
warning: Loadable section "uart_os__i.uart_mem_in_ram" outside of ELF segments
warning: Loadable section "uart__i.uart_open" outside of ELF segments
warning: Loadable section "uart__i.uart_receive" outside of ELF segments
warning: Loadable section "uart_os__i.uart_release_power_votes" outside of ELF segments
warning: Loadable section "uart_os__i.uart_tlmm_close" outside of ELF segments
warning: Loadable section "uart_os__i.uart_tlmm_open" outside of ELF segments
warning: Loadable section "uart__i.uart_transmit" outside of ELF segments
warning: Loadable section "udp6__i.udp6_alloc" outside of ELF segments
warning: Loadable section "udp6__i.udp6_chk_mc" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_chk_overlapped_binding" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_data_upcall" outside of ELF segments
warning: Loadable section "udp6__i.udp6_deliver_mc" outside of ELF segments
warning: Loadable section "udp6__i.udp6_maxalloc" outside of ELF segments
warning: Loadable section "udp6__i.udp6_open" outside of ELF segments
warning: Loadable section "udp6__i.udp6_rcv" outside of ELF segments
warning: Loadable section "udp6__i.udp6_send" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_sockaddr" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_sockbind" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_socksend" outside of ELF segments
warning: Loadable section "udpsock6__i.udp6_soinput" outside of ELF segments
warning: Loadable section "tcpcksum__i.udp_cksum" outside of ELF segments
warning: Loadable section "udpsock__i.udp_close" outside of ELF segments
warning: Loadable section "udpsock__i.udp_lookup" outside of ELF segments
warning: Loadable section "udpsock__i.udp_socket" outside of ELF segments
warning: Loadable section "udpsock__i.udp_soinerr" outside of ELF segments
warning: Loadable section "udpsock__i.udp_soinput" outside of ELF segments
warning: Loadable section "udpsock__i.udp_usrreq" outside of ELF segments
warning: Loadable section "udp6__i.udpswap" outside of ELF segments
warning: Loadable section "ininit__i.update_packets" outside of ELF segments
warning: Loadable section "quartz_ram_stubs__i.user_post_setup" outside of ELF segments
warning: Loadable section "quartz_ram_stubs__i.user_pre_setup" outside of ELF segments
warning: Loadable section "in_utils__i.uslash" outside of ELF segments
warning: Loadable section "ip6mc__i.v6_lookup_mcast" outside of ELF segments
warning: Loadable section "flash_nor__i.vendor_error_check" outside of ELF segments
warning: Loadable section "strrcl_main__i.vote_for_suspend" outside of ELF segments
warning: Loadable section "api_ioctl__i.wait_for_coex_stats" outside of ELF segments
warning: Loadable section "api_ioctl__i.wait_for_get_stats" outside of ELF segments
warning: Loadable section "api_ioctl__i.wait_scan_done" outside of ELF segments
warning: Loadable section "cust_hw_spi__i.wait_spi_done" outside of ELF segments
warning: Loadable section "coex__i.wlan_coex_callback_handler" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_create_device" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_dev0_pkt_send" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_dev1_pkt_send" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_dev_close" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_dev_init" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_dev_stats" outside of ELF segments
warning: Loadable section "cust_api_stack_txrx__i.wlan_drv_buf_dequeue" outside of ELF segments
warning: Loadable section "cust_api_stack_txrx__i.wlan_drv_buf_enqueue" outside of ELF segments
warning: Loadable section "cust_api_stack_txrx__i.wlan_drv_buf_purge_queue" outside of ELF segments
warning: Loadable section "cust_api_stack_txrx__i.wlan_drv_buf_queue_empty" outside of ELF segments
warning: Loadable section "cust_stack_iniche__i.wlan_pkt_send" outside of ELF segments
warning: Loadable section "quartz_ram_stubs__i.wlan_set_deviceid" outside of ELF segments
warning: Loadable section "wmi__i.wmi_bssfilter_cmd" outside of ELF segments
warning: Loadable section "api_init__i.wmi_cmd_process" outside of ELF segments
warning: Loadable section "wmi__i.wmi_cmd_send" outside of ELF segments
warning: Loadable section "wmi__i.wmi_cmd_start" outside of ELF segments
warning: Loadable section "wmi__i.wmi_config_11v_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_control_rx" outside of ELF segments
warning: Loadable section "wmi__i.wmi_control_rx2" outside of ELF segments
warning: Loadable section "wmi__i.wmi_control_rx_p2p" outside of ELF segments
warning: Loadable section "wmi__i.wmi_control_rx_xtnd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_data_hdr_add" outside of ELF segments
warning: Loadable section "wmi__i.wmi_data_hdr_remove" outside of ELF segments
warning: Loadable section "wmi__i.wmi_dix_2_dot3" outside of ELF segments
warning: Loadable section "wmi__i.wmi_dot3_2_dix" outside of ELF segments
warning: Loadable section "wmi__i.wmi_dset_host_cfg_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_get_control_ep" outside of ELF segments
warning: Loadable section "wmi__i.wmi_implicit_create_pstream" outside of ELF segments
warning: Loadable section "wmi__i.wmi_init" outside of ELF segments
warning: Loadable section "wmi__i.wmi_meta_add" outside of ELF segments
warning: Loadable section "wmi__i.wmi_p2p_set_noa" outside of ELF segments
warning: Loadable section "wmi__i.wmi_p2p_set_oppps" outside of ELF segments
warning: Loadable section "wmi__i.wmi_qos_state_init" outside of ELF segments
warning: Loadable section "wmi__i.wmi_sdpd_send_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_send_socket_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_set_appie_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_set_control_ep" outside of ELF segments
warning: Loadable section "wmi__i.wmi_set_wnm_sleep_period_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_set_wnm_sleep_response_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_shutdown" outside of ELF segments
warning: Loadable section "wmi__i.wmi_socket_cmd" outside of ELF segments
warning: Loadable section "wmi__i.wmi_storerecall_recall_cmd" outside of ELF segments
warning: Loadable section "ram_stubs__i.xport_quartz_shutdown" outside of ELF segments
warning: Loadable section "ram_stubs__i.xport_quartz_start" outside of ELF segments
warning: Loadable section "ROM_FOM_RO_REGION__ro-data" outside of ELF segments
warning: Loadable section "ROM_STDLIBS_RO_REGION" outside of ELF segments
warning: Loadable section "ROM_LINKER_SYMS__ro-data" outside of ELF segments
warning: Loadable section "ROM_MOM_MISSIONROM_RW_REGION__rw-data" outside of ELF segments
warning: Loadable section "ROM_SOM_MISSIONROM_RW_REGION__rw-data" outside of ELF segments
warning: Loadable section "ROM_STDLIBS_RW_REGION" outside of ELF segments
warning: Loadable section "ROM_FOM_MISSIONROM_RW_REGION__rw-data" outside of ELF segments
(gdb) break hello_world.c:60
(gdb) info break
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0x0104e7ec in HelloWorld_Thread at ../../src/hello_world.c:60
(gdb) continue
Continuing.
Warning:
Cannot insert breakpoint 3.
Cannot access memory at address 0x104e7ec
 
Command aborted.
(gdb) break hello_world.c:60
 
 
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2018-10-29 14:43

Could you try with default settings of qca402x_openocd.cfg.

Modify
dap create qcatarget -chain-position $_TARGETNAME
target create $_TARGETNAME cortex_m -dap qcatarget

to
target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME

  • Up0
  • Down0
vh
Join Date: 3 Sep 18
Posts: 5
Posted: Tue, 2018-10-30 08:47
Hi,
 
Changing back the config to default(target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME)  gave me the following error:
 
 
user:~/Downloads/QCA4020.OR.2.0_00048/target/quartz/demo/Helloworld_demo/build/gcc$ openocd -f qca402x_openocd.cfg 
Open On-Chip Debugger 0.10.0+dev-00546-g1afec4f5 (2018-10-02-12:05)
Licensed under GNU GPL v2
For bug reports, read
adapter speed: 5000 kHz
embedded:startup.tcl:21: Error: target requires -dap parameter instead of -chain-position!
in procedure 'script' 
at file "embedded:startup.tcl", line 60
in procedure 'target' called at file "qca402x_openocd.cfg", line 81
in procedure 'ocd_bouncer' 
at file "embedded:startup.tcl", line 21
 
This error was also the reason for me to change the config in the first place, is there any chance that I might be using a incompatible version of OpenOCD or a outdated config file?
 
My config file looks as follows:
 
# Target board Qualcomm Quartz QCA4024
 
#
# FTDI interface driver for MPSSE mode of FT2322H
#
 
interface ftdi
 
# The vendor ID and Product ID of the adapter
ftdi_vid_pid 0x0403 0x6010
 
# The USB Device description
# ftdi_device_desc "FT2232C Dual USB-UART/FIFO IC"
 
# Select the Channel of the FTDI device to use for MPSSE operations
ftdi_channel 0
 
# The initial values of the FTDI GPIO data and direction registers
ftdi_layout_init 0x0008 0x00fb
 
transport select jtag
 
adapter_khz 5000
 
set CHIPNAME QM4
set TAPTYPE cpu
set IRLEN 4
set CPUTAPID 0x4ba00477
#
# Qualcomm Quartz 402x target device
#
 
if { [info exists TAPTYPE] } {
    set _TAPTYPE $TAPTYPE
} else {
    set _TAPTYPE cpu
}
 
if { [info exists CHIPNAME] } {
    set _CHIPNAME $CHIPNAME
} else {
    set _CHIPNAME quartzM4
}
 
if { [info exists CPUTAPID] } {
    set _CPUTAPID $CPUTAPID
} else {
    set _CPUTAPID 0x4ba00477
}
 
if { [info exists IRLEN] } {
    set _IRLEN $IRLEN
} else {
    set _IRLEN 4
}
 
jtag newtap $_CHIPNAME $_TAPTYPE -irlen $_IRLEN -expected-id $_CPUTAPID
set _TARGETNAME $_CHIPNAME.$_TAPTYPE
target create $_TARGETNAME cortex_m -chain-position $_TARGETNAME
 
 
 
$_TARGETNAME configure -endian little
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size 0x1000 -work-area-backup 0
 
# Select the Quartz M4 CPU as the current target
targets QM4.cpu
 
init
 
reset halt
 
targets
 
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2018-10-30 10:39

The openocd lastest version has some compatibility issues.
Kindly advise to use older version OpenOCD-20170609 available in "http://gnutoolchains.com/arm-eabi/openocd/".

  • Up0
  • Down0
vh
Join Date: 3 Sep 18
Posts: 5
Posted: Thu, 2018-11-01 04:37

Hi, 

 

I have managed to get debugging to work.  OpenOCD version 20170609 however, is only built for Windows and not for Linux. But the OpenOCD build from the OpenOCD git repo, branch/tag v0.10.0  seems to work fine under Ubuntu 18.04. I don't have the "embedded:startup.tcl:21: Error: target requires -dap parameter instead of -chain-position!" error anymore. Only problem now is that context switching between threads in debugging doesn't seem to be working correctly. The program sometimes gets stuck on exiting a thread and does not switch to another thread unless the board is reset. 

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