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:
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.
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.
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"
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
The openocd lastest version has some compatibility issues.
Kindly advise to use older version OpenOCD-20170609 available in "http://gnutoolchains.com/arm-eabi/openocd/".
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.