JTAG support: how?

Hello,

I want to use JTAG as a debugging tool for my custom board.

What’s the correct way of using it on the dragonboard? I know I have to solder J8 connector; but what then?
Which hardware/software should I use?

I know this topic has been already discussed here but I couldn’t find anything that helps me.

Thank you !

Hi @Vix

You have the right idea, you can connect to J15 on the 410c, or you can connect to the test points (TP8-16) that you can see on the Schematic (page 30 of 33). Connecting to the test points is probably easier, they look like this:

The control hardware is also easy, you can use a FlySwatter2 or a similar device.

The last part of the puzzle is the software. OpenOCD is a good tool and connects the FlySwatter to gdb. I had a team create a project to upgrade OpenOCD to handle 64-bit processors, and the APQ chips in particular, but they are no longer with the company and not supporting this. However there is a speck of light at the end of the tunnel, all of the work they had done is on GitHub here: OpenOCD64. Unfortunately the changes are against an older version of OpenOCD (2015), and I haven’t tested any of this. Think of this as a bag of parts with ‘some assembly required’.

If you decide to take on this challenge, please keep @danielt and I informed as to your progress.

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.

Like @ljking, I don’t think I’ve seen an end-to-end success story on DB410C… “kit of parts” is a great analogy.

I think 64-bit support has already landed on the openocd mainline so I’d suggest making sure you fetch the master branch of openocd… that way you shouldn’t have to patch much.

Roughly speaking:

  1. If openocd cannot read the JTAG ID then assume that you haven’t got the hardware wired up correctly.
  2. If you get a JTAG ID but nothing else assume the software isn’t correctly configured (thinks like the Coresight base addresses)
  3. If you get unpredictable behaviour then lower the adapter clock speed (doubly so if you end up using the test points combined with “long” homemade wiring… JTAG is designed to have ground wires between each signal wire to minimise cross talk).

The OpenOCD64 patch contains a lot more than just 64-bit support. It also contains configuration information for several Qualcomm chips. You will need this in order to access the cores inside the chips. Since this is an older project it doesn’t contain support for the chips we are currently using, but it is a good hint on how to do it.

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.

Thanks for that. I hadn’t spotted that the patch in the repo is actually 94 patches concatenated into one!

you are right.
openocd master contains already armv8/aarch64 suuport, unfortunatelly, there is missing patch, which skips CSYSPWRUPACK polling during dap_dp_init.

@ljking should care more about his openocd contributions i’m going to restore my change and play with suggested way already merged to master

@ljking - what about rework or those 94 patches on top of current master? for example cortex_a53 target doesn’t exists in openocd, there is aarch64 which is more generic as you have several armv8/aarch64 targets like a35/a53/a37/a72…

Hi @indy

I am not the author of any of these patches, additionally I am not really a SW guy (more HW), so I don’t really understand anything in the patches. I did read the instructions and they have you check out a very old point in the OpenOCD tree and apply the patches to that, so I am reasonably sure they do not apply to the current master (the patches are several years old). I just pointed out that the patches exist and you can look at them for guidance on how to access the CPUs inside Qualcomm chips.

The people responsible for the original patches are no longer working on this, so they will not be reworking anything. It is up to you…

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.

i apologize, i thought you are author :slight_smile:

i just jumped on that pile, trying to figure out what should be easily adopted to current master.
but it seems contains some gems like memory maps for cores.

Thank you all for your support. I will let you know if I have to get deeper inside JTAG debugging.