Forums - Problem flashing via JTAG (from Linux)

12 posts / 0 new
Last post
Problem flashing via JTAG (from Linux)
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Tue, 2019-04-16 11:14

Hi,

I'm trying to compile and install the Hello World demo program on a QCA4020 using a Linux PC host.  I got the code to compile, but I get errors with the flash loader.  When I try, it appears that the JTAG interface has failed.  Here's what I see:

> sh flash_openocd.sh
[sudo] password for ...:
Open On-Chip Debugger 0.9.0 (2018-01-21-13:43)
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
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: QM4.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0x7 in JTAG-DP transaction
Warn : Invalid ACK 0 in JTAG-DP transaction
Warn : Invalid ACK 0 in JTAG-DP transaction
Warn : Invalid ACK 0 in JTAG-DP transaction
...

I am running Debian Linux 9.8, with all the latest updates applied.

ARM toolchain is gcc-arm-none-eabi-8-2018-q4-major-linux-tar.bz2

Qualcomm SDK is qca4020.or_.3.0_00011.1.zip

OpenOCD is the latest from Debian - version 0.9.0-1+deb8u1

I set the jumpers according to the Hello World tutorial page (https://developer.qualcomm.com/project/hello-world-w-qca4020-dev-kit):

  • J30 pins 1-2
  • J31 pins 1-2
  • J32 pins 1-2
  • J37 pins 2-3
  • J38 pin2 to J39 pin 3
  • J38 pin3 to J39 pin 2

 

Here's an image of the board

I tried the same procedure using Ubuntu 18.04 LTS running in a VirtualBox VM on Windows 10, but got the same results.

What am I missing here?  Any help would be most appreciated

-- David

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Tue, 2019-04-16 11:44

I just tried compiling OpenOCD verson 0.10.  It still fails, but with more verbose messages (because I enabled verbose messags):

> sh flash_openocd.sh
Open On-Chip Debugger 0.10.0 (2019-04-16-14:34)
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
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: QM4.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
...

So I don't think it's due to an outdated version of OpenOCD.

-- David

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

Apologies for the confusion in the jumper settings,

From the provided information, we could observer one of the jumper connections is missing.

Kindly connect the jumper settings as below and let us now if you still face issue while flashing the images ?

J30 pins 1-2
J31 pins 1-2
J32 pins 1-2
J37 pins 2-3
J40 pins 2-3 ***
J38 pin2 to J39 pin 3
J38 pin3 to J39 pin 2

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Tue, 2019-04-16 13:19

Thanks.  I also discovered that the original instructions omitted the pins on J40.  I installed that jumper, but there is still no JTAG connectivity.

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Tue, 2019-04-16 21:36

we have verified openOCD jtag setup on Ubuntu 18.04.

Kindly use openocd from http://gnutoolchains.com/arm-eabi/openocd/ and use version OpenOCD-20170609 and let us know if you still face the same issue.

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Wed, 2019-04-17 05:37

That link is for Windows software (and version 20170609 is not available there).

version 0.10.0 was released on January 22, 2017.  I have tested with it both on Debian and on Ubuntu 18.04 (in a VM).

The head-of-line branch ("master") doesn't work with our scripts - it produces an error:

> sh flash_openocd.sh
Open On-Chip Debugger 0.10.0+dev-00796-ga4ac5615 (2019-04-16-14:51)
Licensed under GNU GPL v2 For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
adapter speed: 5000 kHz
embedded:startup.tcl:17: Error: target requires -dap parameter instead of -chain-position!
in procedure 'script'
at file "embedded:startup.tcl", line 56
in procedure 'target' called at file "qca402x_openocd.cfg", line 81
in procedure 'ocd_bouncer'
at file "embedded:startup.tcl", line 17
...

 

I would like to try version 20170609, but I don't know how to get the sources for that version, since the git repo doesn't have a tag for that date and the link you provided only provides Windows binaries.

Is there a tutorial file somewhere that describes how to set up a working development environment on Linux?  The only link to the Hello World app I could find (above) is for Windows, so it is likely that I did something wrong when I tried to adapt those instructions to my Linux environment.

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Thu, 2019-04-18 09:03

I just finished installing the toolchain on Windows and I'm seeing the same problem.  When I try to flash the board, I see the following:

 

Open On-Chip Debugger 0.10.0 (2017-08-21) [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
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : clock speed 5000 kHz
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: QM4.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
...

I could not download OpenOCD version 2017-06-09, because it's no longer available.  I used the 2017-08-21 release.

I am bothered by the error that libusb_open() failed.  I followed the instructions and used Zadig to install the WinUSB driver on the "Dual RS232-HS (Interface 0)" device.  Was that not correct, perhaps?

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Thu, 2019-04-18 11:45

I think I found the low-level JTAG problem.  My laptop doesn't provide enough current on its USB port.

It is necessary to attach the power brick to J6 in addition to the USB cable to the computer at J85.  The symptom of this situation is a blinking power light (instead of it being bright and steady).  You may want to update the tutorial page to explicitly mention this.  I didn't see this explicitly documented anywhere and assumed that the computer's own power would be enough because I could see the USB device.

At this point the flashing seems to be working.  At least I see a lot of messages from GDB.  But I'm not seeing Hello World output on the serial port, so maybe something else is wrong.  I'm going to start a new thread for that issue.

  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-04-18 12:33
Kindly refer to document QCA402x (CDB2x) Development Kit User Guide under https://developer.qualcomm.com/hardware/qca4020-qca4024/tools-qca4020 for installing openocd, build and flash instructions.
  • Up0
  • Down0
c_rpedad
Profile picture
Join Date: 18 Jun 18
Location: San Jose
Posts: 317
Posted: Thu, 2019-04-18 12:38
Regarding the power setting via USB port, refer to section :"CDB20 customer development board jumper settings" of development kit. Jumper settings: J6 USB Power Source (Option1) J57 = Connect pins 2 and 3 for J6 Power J85 USB Power Source (Option2) J57 = Connect pins 1 and 2 for J85 Power
  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Thu, 2019-04-18 13:07

Thank you for your help here.  I didn't realize that the two power jumpers (J36 and J57) - have pin 1 in the rightmost position (when the board is held such that the text is readable), which is opposite to the way all of the other jumpers on the board are oriented.

  • Up0
  • Down0
david_charlap
Join Date: 3 Apr 19
Posts: 17
Posted: Thu, 2019-04-18 17:11

I have now found out why the code wasn't running (passed wrong parameters to build.bat).  It's working now.

Thanks much for your help regarding jumper settings.

I still think there should be a document listing simple step-by-step instructions for setting up a build environment on all three platforms (Windows, Linux and macOS) but that's beyond the scope of this discussion thread.

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