Forums - Flash the image using JTAG - error

10 posts / 0 new
Last post
Flash the image using JTAG - error
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Fri, 2018-05-18 02:45

Hi, We are trying to use OpenOCD to interact with the module in Windows 10.

We can't flash image using JTAG in windows10.

Our  openocd is from here (https://github.com/gnu-mcu-eclipse/openocd/releases/tag/gae-0.10.0-20160110)

and chose (gnuarmeclipse-openocd-win64-0.10.0-201601101000-dev-setup.exe).

 

When we run "flash_openocd.bat", we got the following msg:

[2018-05-18 17:01:00,796] INFO: GDB can run without shell=true File:flash_through_gdb.py:416 Function:_check_need_shell
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: 308 KB/sec, 8104 bytes/write.
Breakpoint 1 at 0x1004614c: file /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c, line 125.
Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125 /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.
"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)
Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125 in /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c
Info : dropped 'gdb' connection
[2018-05-18 17:01:01,295] DEBUG: D:/install/GNU Tools ARM Embedded/2017-q4-major/bin/arm-none-eabi-gdb.exe --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:432 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.

 

We don't know why it has wrongs, but we have made sure that it can run in Linux(Ubuntu).

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Fri, 2018-05-18 04:24

Hi , 

So you are facing issue while flashing via JTAG from Windows 10 but it works well on linux ? Is that correct?

Please kindly confirm .

 

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Sat, 2018-05-19 05:56

Hi , Yes we just met this issue on windows10.

We try to use the openocd version(gnu-mcu-eclipse-openocd-0.10.0-8-20180512-1921-win64) from https://github.com/gnu-mcu-eclipse/openocd/releases

Dose it need to install or enable something?

When we run flash_openocd.bat , It can't connect with localhost 3333.

The following msg:

GNU MCU Eclipse 64-bits Open On-Chip Debugger 0.10.0+dev-00487-gaf359c18 (2018-05-12-19:30)
Licensed under GNU GPL v2
For bug reports, read
 http://openocd.org/doc/doxygen/bugs.html
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 61
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 21
[2018-05-19 20:09:26,326] INFO: Checking for files to add to the image for Firmware Descriptor Table 0 File:gen_fwd_table.py:654 Function:gen_xml_program
[2018-05-19 20:09:26,365] INFO: Done Generating XML file to program. File:gen_fwd_table.py:692 Function:gen_xml_program

Starting GDB Server....
[2018-05-19 20:09:27,049] INFO: flash_through_gdb.py version 1.0.5 File:flash_through_gdb.py:577 Function:main
[2018-05-19 20:09:27,954] DEBUG: Output Directory is gdbout/ File:flash_through_gdb.py:609 Function:main
[2018-05-19 20:09:27,954] DEBUG: Search Path 1 .\output/ File:flash_through_gdb.py:621 Function:main
[2018-05-19 20:09:27,954] DEBUG: Search Path 2 ..\..\..\..\..\bin\cortex-m0\threadx\ File:flash_through_gdb.py:621 Function:main
[2018-05-19 20:09:27,954] DEBUG: Search Path 3 ..\..\..\..\..\bin\wlan/ File:flash_through_gdb.py:621 Function:main
[2018-05-19 20:09:27,969] DEBUG: Search Path 4 ./ File:flash_through_gdb.py:621 Function:main
[2018-05-19 20:09:27,970] ERROR: The file firmware_table.bin is found in two places .\output/firmware_table.bin and ./firmware_table.bin, using the first File:flash_through_gdb.py:60 Function:search_for_file
[2018-05-19 20:09:27,970] INFO: Will write file .\output/firmware_table.bin into sectors [0, 0] File:flash_through_gdb.py:656 Function:main
[2018-05-19 20:09:27,970] DEBUG: D:/install/GNU Tools ARM Embedded/2017-q4-major/bin/arm-none-eabi-gdb.exe --command="gdbout/gdb_commands.txt" --batch File:flash_through_gdb.py:432 Function:run

GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-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:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
[2018-05-19 20:09:28,025] INFO: GDB can run without shell=true File:flash_through_gdb.py:416 Function:_check_need_shell
gdbout/gdb_commands.txt:1: Error in sourced command file:
localhost:3333: 無法連線,因為目標電腦拒絕連線。
.
[2018-05-19 20:09:29,128] ERROR: Unable to open the file 'gdbout/command_result.log'
 File:flash_through_gdb.py:237 Function:_check_status
Traceback (most recent call last):
  File "..\..\..\..\..\build\tools\flash/flash_through_gdb.py", line 230, in _check_status
    f = open(self.cmd_status_file , 'rb')
IOError: [Errno 2] No such file or directory: 'gdbout/command_result.log'
[2018-05-19 20:09:29,128] WARNING: The last command return error
 File:flash_through_gdb.py:240 Function:_check_status
[2018-05-19 20:09:29,128] ERROR: Failed to write to start sector=0, num sectors=1 File:flash_through_gdb.py:659 Function:main

Flash Operation Completed Successfully...

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Mon, 2018-05-21 01:59

Hi , 

Have you followed below steps of  UserGuide? It is needed. I am able to flash succssfully inWindows10. 

3.7.2.1 Install FTDI driver for JTAG  for Windows

Steps i followed-

1. Install OpenOCD version is 0.10.0 available at http://openocd.org/ .

OpenOCD: OpenOCD plugin is required to establish the connection between Eclipse IDE and onboard FTDI JTAG debugger. The supported version is 0.10.0 available at http://openocd.org/. After installation, add the path to OpenOCD. Example: If there is openocd.exe in C:\ Program Files OpenOCD-20170609\bin , set path as follows: set %PATH%=%PATH%:C:\ Program Files OpenOCD-20170609\bin 

2. Install FTDI driver for JTAG 

3. CDB20 customer development board jumper settings for JTAG. (I hope you have done it , as success in LINUX)

4. Connect both J6 & J85 usb . 

5. Run flash_openocd.bat to flash via JTAG 

 

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Mon, 2018-05-21 04:43

It seems to be a setup issue. 

Can you please share  me your command_result.txt & gdb_command.txt  file present inside gdbout folder.

  • Up0
  • Down0
angus.ku
Join Date: 3 May 18
Posts: 20
Posted: Mon, 2018-05-21 21:24

Hi 

We can flash image using  JTAG finally!!

The reason seems that it used the wrong  firmware_table.bin.

Previously, In win10, we used Helloworld_demo and to flash image using USB first 

It made 3 files(firmware_table.bin/generated_fwd_table.xml/generated_partition_table.xml) at output folder under the project.

If we don't kill them, and to flash image using  JTAG and then reboot it, we found it can't output any msgs on terminal.

It seems something wrong. After that we kill those files, and to flash image using  JTAG again, it can work!

We would like to know that whether these files have to be deleted manually ?

Many Thx

 

 

 

The contents of gdb_commands_list.txt [NG]

target remote localhost:3333
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 .\\output/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 .\output/firmware_table.bin binary jtag_prog_param.data-0 0 4096
continue

...

The contents of gdb_commands_list.txt [OK]

target remote localhost:3333
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

 

 

  • Up0
  • Down0
jbhanu Moderator
Join Date: 6 Feb 17
Posts: 80
Posted: Mon, 2018-05-21 22:37

Hi , 

Nice to listen this. Great!! . 

Yes, right. That files need to be deleted , if you want to flash by JTAG and previousy it has been flashed by USB.

Else after flashing via USB , recompile and flash by JTAG, it will work too . 

It seems some changes need to be made on scripts. We are making those. Once done, I will update you. 

=========================================================================================================

I thought you stuck on middle of the flashing , so just asked those .txt file. Now no need. It is working fine for ypou. 

  • Up0
  • Down0
hitenpadiya7
Join Date: 20 Aug 18
Posts: 2
Posted: Mon, 2018-08-20 04:17

Hi team,

we are getting the same error while flashing using JTAG.

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125 /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.

We tried both flash.bat and flash.sh in cmd and using cygwin also. But error remains the same.

  • Up0
  • Down0
hitenpadiya7
Join Date: 20 Aug 18
Posts: 2
Posted: Mon, 2018-08-20 06:20

hi team,

we are getting the same error while flashing using flash.bat in windows.

Breakpoint 1, main_c () at /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c:125
125 /local/mnt/workspace/CRMBuilds/CNSS_W.QZ.1.1-00023-QZHW-1_20180405_143126/b/ioesw_proc/core/storage/tools/jtagprogrammer/src//JtagProgrammer.c: No such file or directory.

we have also tried flash.sh in cygwin but error remains same

 

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Mon, 2018-08-20 10:57

Could you please confirm if you are using QCA4020 EVK+MB or CDB4020 device ?

In case of CDB4020 you need to run flash_openocd.bat/ flash_openocd.sh.
In case of QCA4020EVK you need to execute flash.bat/ flash.sh.

Kindly refer to respective documentation for more information on prerequisites, board settings and flashing instructions.

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