Hi,
I set my code to to built for onboarding using Wifi by doing this
build.bat t 4020 2 1 1 cdb // as a ZigBee COORDINATOR
the C/C++ Build settings as below:
Builder Settings: Build command: build.bat
Build Behavior: Build(Incremental Build) t 4020 2 1 1 cdb
This is the initial view at the console during building...
CDB
****************************************************************************
Building Onboard AWS demo for v2 Chipset
RTOS threadx
CHIPSET VARIANT qca4020
Onboard Via WIFI
Battery Operated 0
Ecosystem awsiot
*****************************************************************************
"Building for AWS"
Exporting Device config files....
After I flashed in using the Eclipse IDE, I boot up my board, why I still get this...
Onboard: /*---------------------------------------------------------------*/
Onboard: Image build time: Thu Apr 05 14:32:27 2018
Onboard: Chipset version : qca4020
Onboard: RTOS : threadx
Onboard: Onboarding VIA : BLE
Onboard: Onboardable Radios:
Onboard: WIFI
Onboard: ZIGBEE
Onboard: /*-----------------------------------------------------------------*/
Onboard: read_wifi_config
It shows it's onboarding using BLE.
When I look at the date, it looks like it's an old code. Does that mean I didn't manage to flash in successfully? But I really saw the message saying the flashing is successful.
This is the console output while flashing...
Open On-Chip Debugger 0.10.0 (2018-07-28) [https://github.com/sysprogs/openocd]
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
[2018-08-31 18:30:35,644] INFO: Checking for files to add to the image for Firmware Descriptor Table 0 File:gen_fwd_table.py:673 Function:gen_xml_program
[2018-08-31 18:30:35,747] INFO: Done Generating XML file to program. File:gen_fwd_table.py:711 Function:gen_xml_program
Starting GDB Server....
[2018-08-31 18:30:36,282] INFO: flash_through_gdb.py version 1.0.5 File:flash_through_gdb.py:596 Function:main
[2018-08-31 18:30:36,907] DEBUG: Output Directory is gdbout/ File:flash_through_gdb.py:628 Function:main
[2018-08-31 18:30:36,907] DEBUG: Search Path 1 .\output/ File:flash_through_gdb.py:640 Function:main
[2018-08-31 18:30:36,907] DEBUG: Search Path 2 ..\..\..\..\..\bin\cortex-m0\threadx\ File:flash_through_gdb.py:640 Function:main
[2018-08-31 18:30:36,907] DEBUG: Search Path 3 ..\..\..\..\..\bin\wlan/ File:flash_through_gdb.py:640 Function:main
[2018-08-31 18:30:36,907] DEBUG: Search Path 4 ./ File:flash_through_gdb.py:640 Function:main
[2018-08-31 18:30:36,931] INFO: Will write file ./firmware_table.bin into sectors [0, 0] File:flash_through_gdb.py:675 Function:main
[2018-08-31 18:30:36,931] DEBUG: C:/GNU_Tools_ARM_Embedded/4.9_2015q3/bin/arm-none-eabi-gdb.exe --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:451 Function:run
GNU gdb (GNU Tools for ARM Embedded Processors) 7.8.0.20150604-cvs
Copyright (C) 2014 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".
[2018-08-31 18:30:37,104] INFO: GDB can run without shell=true File:flash_through_gdb.py:435 Function:_check_need_shell
gdbout/gdb_commands.txt:1: Error in sourced command file:
localhost:3333: The system tried to join a drive to a directory on a joined drive.
[2018-08-31 18:30:52,553] ERROR: Unable to open the file 'gdbout/command_result.log'
File:flash_through_gdb.py:256 Function:_check_status
Traceback (most recent call last):
File "..\..\..\..\..\build\tools\flash/flash_through_gdb.py", line 249, in _check_status
f = open(self.cmd_status_file , 'rb')
IOError: [Errno 2] No such file or directory: 'gdbout/command_result.log'
[2018-08-31 18:30:52,555] WARNING: The last command return error
File:flash_through_gdb.py:259 Function:_check_status
[2018-08-31 18:30:52,555] ERROR: Failed to write to start sector=0, num sectors=1 File:flash_through_gdb.py:678 Function:main
Flash Operation Completed Successfully...
Anyone can solve this?
Hope to hear from you soon.
Regards,
Nelson
From the attached flash logs, the device is not flashed with latest image.
gdbout/gdb_commands.txt:1: Error in sourced command file:
localhost:3333: The system tried to join a drive to a directory on a joined drive.
[2018-08-31 18:30:52,553] ERROR: Unable to open the file 'gdbout/command_result.log'
OError: [Errno 2] No such file or directory: 'gdbout/command_result.log'
[2018-08-31 18:30:52,555] WARNING: The last command return error
2018-08-31 18:30:52,555] ERROR: Failed to write to start sector=0, num sectors=1
If you observer the whole flash log , you can find some "JTAG-DP STICKY ERROR" with INVALID ACK ERROR CODE.
The reason for this issue can be either the jumper connections are invalid or the JTAG jumper connections are not accurate.
Please recheck the JTAG jumper settings and try flashing the image.
Hi Raja,
I am following the table CDB20 customer development board jumper settings on page 289 of document "80-ya121-140-qca402xcdb2x_development_kit_user_guide.pdf" on row JTAG. I connected the jumpers as instructed.
But still i can't flash into the board. I still get this error...
Hi Raja,
I suspect that the OpenOCD I used is not compatible.
So, I have followed this link https://developer.qualcomm.com/project/hello-world-w-qca4020-dev-kit on step 4 to download the OpenOCD-20170609 at http://gnutoolchains.com/arm-eabi/openocd/
I ran through the flashing, I got the different error now. But it's still not successfully flashed it yet.
This is the error...
Hi Raja,
I suspect that the OpenOCD I used is not compatible.
So, I have followed this link https://developer.qualcomm.com/project/hello-world-w-qca4020-dev-kit on step 4 to download the OpenOCD-20170609 at http://gnutoolchains.com/arm-eabi/openocd/
I ran through the flashing, I got the different error now. But it's still not successfully flashed it yet.
This is the error...
Kindly verify if you are able to detect openocd on the system.
Please provide us the complete console output of below commands :
>> openocd -v
>> In first terminal @build/gcc:$ openocd -f qca402x_openocd.cfg //the device should halt connected to QCA4020 device.
If your device is connected, we can confirm openocd is working as expected.
>> @build/gcc:$ flash_openocd.bat //Run this command to flash the contents to the QCA4020 device
Hi Raja,
I attach the output of the 2 commands below.
From the attached console logs, its evident that openocd is compatible and working as expected.
Could you confirm that you are using flash_openocd.bat script for flashing the image.
You can also verify using command line by running flash_openocd.bat to flash the image.
Kindly confirm, if flashing is working using both methods.
Hi Raja,
If I used the command-line method, I still got the error.
But for both methods, if I left it, letting it continue for a few minutes, it will finish successfully. I can see my change was loaded into the board.
For example, when I changed onboarding method to wifi, t 4020 2 1 1 cdb (at Project->Properties->C/C++ Build->Behavior), when booting up, I can see the serial console showing the onboarding via WIFI.
If I changed onboarding method to BLE, 4020 1 1 1 cdb, can see when booting up, onboarding via BLE.
This shows the changes are flashed in. But during the process, it keeps showing the error messages. Is that proper?
Regards,
Nelson
There is no issue in you flashing procedure.
If you observer and trace with "ERROR: Failed to write to start sector=0, num sectors=1 " this should be considered as an issue and flashing will not work.The reason can be either build environment/ JTAG jumper settings or OpenOCD settings.
To confirm if JTAG flash is working, you can verify using the below steps:
> STEP1: Confirm Openocd is compatible and detected by the CDB device.
Open On-Chip Debugger 0.10.0 (2017-06-09) [https://github.com/sysprogs/openocd]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
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
> STEP2: Confirm GDB server is able to detect required images and able to connect to target
Starting GDB Server....
[2018-09-05 11:54:26,651] INFO: flash_through_gdb.py version 1.0.5 File:flash_through_gdb.py:596 Function:main
....
[2018-09-05 11:54:27,486] INFO: GDB can run without shell=true File:flash_through_gdb.py:435 Function:_check_need_shell
Info : accepting 'gdb' connection on tcp/3333
...
Start address 0x100462c2, load size 24312
Transfer rate: 178 KB/sec, 8104 bytes/write.
...
"WRITE .\output/firmware_table.bin, offset=0 start_sector=0 num_sectors=1"Restoring binary file .\output/firmware_table.bin into memory (0x10081bf8 to 0x10082bf8)
Info : dropped 'gdb' connection (error -400)
> STEP3: Check for GDB flashing image status
[2018-09-05 11:54:29,289] DEBUG: C:/QCA402X/6 2017-q2-update/bin/arm-none-eabi-gdb.exe --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:451 Function:run
Info : accepting 'gdb' connection on tcp/3333
.....
"READ gdbout/firmware_table.bin_readback, append=0 start_sector=0 num_sectors=1"
...
Info : accepting 'gdb' connection on tcp/3333
...
Start address 0x100462c2, load size 24312
Transfer rate: 258 KB/sec, 8104 bytes/write.
...
"WRITE .\output/Quartz_HASHED.elf, offset=0 start_sector=35 num_sectors=8"Restoring binary file .\output/Quartz_HASHED.elf into memory (0x10081bf8 to 0x10089bf8)
...
"WRITE .\output/Quartz_HASHED.elf, offset=32768 start_sector=43 num_sectors=8"Restoring binary file .\output/Quartz_HASHED.elf into memory (0x10081bf8 to 0x10089bf8)
...
"WRITE .\output/Quartz_HASHED.elf, offset=65536 start_sector=51 num_sectors=8"Restoring binary file .\output/Quartz_HASHED.elf into memory (0x10081bf8 to 0x10089bf8)
...
"READ gdbout/Quartz_HASHED.elf_readback, append=1 start_sector=75 num_sectors=8"
...
"WRITE ..\..\..\..\..\bin\cortex-m0\threadx\ioe_ram_m0_threadx_ipt.mbn, offset=65536 start_sector=161 num_sectors=6"Restoring binary file ..\..\..\..\..\bin\cortex-m0\threadx\ioe_ram_m0_th
readx_ipt.mbn into memory (0x10081bf8 to 0x10087278)
...
"READ gdbout/wlan_fw_img.bin_readback, append=1 start_sector=191 num_sectors=5"
...
$1 = "ERASE start_sector=19 num_sectors=16"
...
$1 = "ERASE start_sector=1 num_sectors=2"
...
Info : dropped 'gdb' connection (error -400)
[2018-09-05 11:55:35,775] INFO: Script finished processing generated_fwd_table.xml File:flash_through_gdb.py:718 Function:main
Flash Operation Completed Successfully...
SUCCESS: The process "openocd.exe" with PID 3648 has been terminated.
Kindly note, during the whole flashing procedure, you will observer multiple GDB connections and the whole procedure might take approx 1-2 minutes.