Forums - Failure to Flash QCA4020

10 posts / 0 new
Last post
Failure to Flash QCA4020
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 08:47

I am having much the same problem as described in https://developer.qualcomm.com/forum/qdn-forums/hardware/qca4020-qca4024/35815

I have tried following the user guide on Windows and on Linux. Right now I am trying from Linux to flash from the command line using flash_openocd.sh for Helloworld_demo.

I'm using the CDB20 board. I'm running on Ubuntu 18.04. I've done the following:

  1. installed openocd via apt
  2. downloaded the openocd repo, checkout out v0.10.0 and run ./configure --enable-ftdi. (It's not clear if this is only required for JTAG debugging, but one of the comments in the post referenced above suggests you need to run it to flash progam).
  3. downloaded and ensured arm-none-eabi-gdb is on the path
  4. ensured openocd is on my path
  5. built the Helloworld_demo per the user guide (not sure if the example env vars are the correct ones for my setup but it seemed to build fine).
  6. I connected the jumpers as described in the user guide appendix.

It's not clear to me  which connectors I should use for the JTAG connection. The appendix mentions GPIO27:24. Am I to use the GPIO pins or can I use the USB for JTAG programming? It certainly seems like the USB is sufficient since I'm able to connect via openocd using the provided config file (just running the openocd command from flash_openocd.sh from the command line).

I've attached a photo of my board to show jumper layout (it's not perfectly obvious, but I have properly cross-connected J38 pin 2 to J39 pin 3 and J38 pin3 to J39 pin2). Here is the first snippet of output from flash_openocd.sh (similar to the output from the above referenced post).

Open On-Chip Debugger 0.10.0
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.
[2019-06-06 09:20:53,459] INFO: Checking for files to add to the image for Firmware Descriptor Table 0 File:gen_fwd_table.py:673 Function:gen_xml_program
[2019-06-06 09:20:53,460] INFO: Done Generating XML file to program. File:gen_fwd_table.py:711 Function:gen_xml_program
[2019-06-06 09:20:53,486] INFO: flash_through_gdb.py version 1.0.5 File:flash_through_gdb.py:596 Function:main
[2019-06-06 09:20:53,490] DEBUG: Output Directory is gdbout/ File:flash_through_gdb.py:628 Function:main
[2019-06-06 09:20:53,491] DEBUG: Search Path 1 /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/ File:flash_through_gdb.py:640 Function:main
[2019-06-06 09:20:53,491] DEBUG: Search Path 2 /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/bin/cortex-m0/threadx/ File:flash_through_gdb.py:640 Function:main
[2019-06-06 09:20:53,491] DEBUG: Search Path 3 /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/bin/wlan/ File:flash_through_gdb.py:640 Function:main
[2019-06-06 09:20:53,491] DEBUG: Search Path 4 ./ File:flash_through_gdb.py:640 Function:main
[2019-06-06 09:20:53,492] ERROR: The file firmware_table.bin is found in two places /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/firmware_table.bin and ./firmware_table.bin, using the first File:flash_through_gdb.py:79 Function:search_for_file
[2019-06-06 09:20:53,492] INFO: Will write file /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/firmware_table.bin into sectors [0, 0] File:flash_through_gdb.py:675 Function:main
[2019-06-06 09:20:53,492] DEBUG: /home/mwardle/work/gnu-rm/gcc-arm-none-eabi-6-2017-q2-update/bin//arm-none-eabi-gdb --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:451 Function:run
[2019-06-06 09:20:53,493] INFO: GDB may require shell=true, will try on shell mode File:flash_through_gdb.py:437 Function:_check_need_shell
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
Info : accepting 'gdb' connection on tcp/3333
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x000001c0 in ?? ()
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x3ac lma 0x10080000
Start address 0x100462c2, load size 24312
Transfer rate: 296 KB/sec, 8104 bytes/write.
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125    /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.
"WRITE /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/firmware_table.bin, offset=0 start_sector=0 num_sectors=1"Restoring binary file /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/firmware_table.bin into memory (0x10081bf8 to 0x10082bf8)

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125    in /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c
Info : dropped 'gdb' connection
[2019-06-06 09:20:53,926] DEBUG: /home/mwardle/work/gnu-rm/gcc-arm-none-eabi-6-2017-q2-update/bin//arm-none-eabi-gdb --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:451 Function:run
Info : accepting 'gdb' connection on tcp/3333
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x1004614c in ?? ()
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x3ac lma 0x10080000
Start address 0x100462c2, load size 24312
Transfer rate: 269 KB/sec, 8104 bytes/write.
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125    /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.
"READ gdbout/firmware_table.bin_readback, append=0 start_sector=0 num_sectors=1"
Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125    in /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c
Info : dropped 'gdb' connection
[2019-06-06 09:20:54,387] INFO: Data successfully flashed to disk for /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/firmware_table.bin File:flash_through_gdb.py:692 Function:main
[2019-06-06 09:20:54,388] ERROR: The file Quartz_HASHED.elf is found in two places /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/Quartz_HASHED.elf and ./Quartz_HASHED.elf, using the first File:flash_through_gdb.py:79 Function:search_for_file
[2019-06-06 09:20:54,388] INFO: Will write file /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/Quartz_HASHED.elf into sectors [35, 147] File:flash_through_gdb.py:675 Function:main
[2019-06-06 09:20:54,388] DEBUG: /home/mwardle/work/gnu-rm/gcc-arm-none-eabi-6-2017-q2-update/bin//arm-none-eabi-gdb --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:451 Function:run
Info : accepting 'gdb' connection on tcp/3333
warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x1004614c in ?? ()
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x3ac lma 0x10080000
Start address 0x100462c2, load size 24312
Transfer rate: 272 KB/sec, 8104 bytes/write.
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125    /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.3.0-00078-QZHW-1_20181109_142759/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.
"WRITE /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/Quartz_HASHED.elf, offset=0 start_sector=35 num_sectors=8"Restoring binary file /home/mwardle/work/qca4020/QCA4020.OR.3.0_00011.1/target/quartz/demo/Helloworld_demo/build/gcc/output/Quartz_HASHED.elf into memory (0x10081bf8 to 0x10089bf8)

 


 

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 11:18

I tried the same thing using the QCA4024 board (with the appropriate code, instructions, and jumper settings) and got the same errors.

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 11:59

For the record, my steps very much reflected the instructions referred to in https://developer.qualcomm.com/forum/qdn-forums/hardware/qca4020-qca4024.... To be sure, I reran using the steps listed in the blog posting with the same errors.

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-06-06 12:52

Kindly ignore any warnings during flashing operation.
Usually the flahsing will take a minute or so, the error reported in this case (ERROR: The file *** is found in two places) can be ignored as GDB will take the first file and try to copy it into flash.

Kindly confirm after flahsing the image, Remove Jumper J31(pins 1 and2) and reset the board.
Open serial console to verify if you are able to see "Hello World" trace being printed .

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 13:28

Thank you for the quick reply.

I did move forward assuming the errors could be ignored but saw nothing in my serial console.

Just as a double check, I can also ignore the following error message?

warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x000001c0 in ?? ()
Loading section RAM_FOM_APPS_RO_REGION, size 0x5b4c lma 0x10046000
Loading section RAM_FOM_APPS_RW_REGION, size 0x3ac lma 0x10080000

Thanks!

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-06-06 14:46

Yes, you can ignore the warning you have mentioned:

To confim if the flashing is working or  not, you can search for "start_sector", the value will increment based on "num_sectors".

Example:

"WRITE ./firmware_table.bin, offset=0 start_sector=0 num_sectors=1"Restoring binary file ./firmware_table.bin into memory (0x10081bf8 to 0x10082bf8)
"READ gdbout/firmware_table.bin_readback, append=0 start_sector=0 num_sectors=1"
"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=458752 start_sector=147 num_sectors=1"Restoring binary file .\output/Quartz_HASHED.elf into memory (0x10081bf8 to 0x10081c38)
"READ gdbout/Quartz_HASHED.elf_readback, append=0 start_sector=35 num_sectors=8"
...............
"READ gdbout/Quartz_HASHED.elf_readback, append=1 start_sector=147 num_sectors=1"
...............
"READ gdbout/wlan_fw_img.bin_readback, append=1 start_sector=194 num_sectors=7"
$1 = "ERASE start_sector=3 num_sectors=16"
$1 = "ERASE start_sector=19 num_sectors=16"
$1 = "ERASE start_sector=1 num_sectors=2"

 

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 15:27

Thank you for your help so far.

I'm seeing the same sector increments as you have posted.

I tried again to remove the J31 jumper, power cycled, and watched /dev/ttyUSB0 and /dev/ttyUSB1 (I checked before and after connecting the board -- no /dev/ttyUSB* before and then /dev/ttyUSB0 and /dev/ttyUSB1 after). I monitored them using minicom with 115200 baud, 8 bps, no parity, 1 stop bit, and no hardware or software flow control. These are the settings I use to talk with other Qualcomm products but just in case, are they correct?

I don't have to switch jumpers to enable UART debug do I?

 

 

 

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Thu, 2019-06-06 15:31

I was sure I had tried this prievously. I switched the jumpers to Debug UART mode and then I started getting the output I expected.

Thanks again!

  • Up0
  • Down0
mwardle
Join Date: 4 Jun 19
Posts: 7
Posted: Fri, 2019-06-07 06:33

I guess part of the problem was how I expected the serial console to show up. The documentation seems to suggest that it should just show up by removing J31 and power cycling. My experience required me to switch the board jumpers to Category "Serial", whose description says Debug UART(GPIO9:8), and then power cycle (including removing the USB cable). Am I seeing this clearly? Does this jumper configuration route GPIO9:8 to the UART USB port (J85)?

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Fri, 2019-06-07 15:33

By default all the boards will be shipped with Debug UART configuration Jumpers. Hence no modifications are requred.
However, if any pins are removed, you need to have the Power, LED, Serial Category jumpers settings to verify the serial console.

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