How to debug via JTAG on Hikey970?


#1

Hi,

I want to use a Segger J-Link Pro JTAG debugger to help me debug one PCIe problem that makes the kernel crash when two PCIe devices are present (e.g the onboard Realtek 6818 Ethernet and a mini-PCIe 802.11ac radio module).

My J-Link is connected via a ARM-JTAG-20-10 from Olimax to the female JTAG header on the Hikey970 (using an additional male-male 10 pin header).
When attempting to connect using the JLinkExe, the target voltage is correctly detected as 1.8V but I can’t connect/attach to the CPU.

C:\Program Files (x86)\SEGGER\JLink_V640>JLink.exe -device Cortex-A53
SEGGER J-Link Commander V6.40 (Compiled Oct 26 2018 15:06:29)
DLL version V6.40, compiled Oct 26 2018 15:06:02

Connecting to J-Link via USB...O.K.
Firmware: J-Link Pro V4 compiled Oct 26 2018 12:05:09
Hardware version: V4.00
S/N: xxxxxxxxx
License(s): RDI, FlashBP, FlashDL, JFlash, GDB
IP-Addr: 192.168.100.2
VTref=1.833V


Type "connect" to establish a target connection, '?' for help
J-Link>connect
Please specify target interface:
  J) JTAG (Default)
  S) SWD
  T) cJTAG
TIF>S
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>auto
Device "CORTEX-A53" selected.

Connecting to target via SWD
Found SW-DP with ID 0x5BA02477
Failed to power up DAP
Found SW-DP with ID 0x5BA02477
Failed to power up DAP
Found SW-DP with ID 0x5BA02477
Failed to power up DAP
Found SW-DP with ID 0x5BA02477
Failed to power up DAP
Cannot connect to target.
J-Link>

The J-link input led (arrow from target to pc) is Orange constant, which according to the J-Link doc, seems to indicate that the target is in reset state…but this is not true because board has booted and is running linux. The J-Link output led is off.

The Hikey970 schematics doc refers two JTAG_SEL pins but the remaining documentation does not say how to set these pins or how to use the JTAG. This Hikey960 post seems to refer some steps how to enable the JTAG but I am not sure if they apply to the Hikey970…and they were not completely clear to me.

I’ve also tried to follow the OpenOCD JTAG and Hikey steps without success.

Has anyone tried to use the JTAG on the Hikey970?
Do I need to run some special J-Link script to enable the Hi3670 JTAG debug (based on Cortex A53/A73)?

Any suggestions/guidance would be very much appreciated.

Thanks.


Hikey970 running Debian image: Two PCIe devices cause kernel crash (possible race condition?)
#2

I apologize for insisting on this subject but so far, I couldn’t find anyone that reported to have been able to use the JTAG on the Hikey970 or to give me a little more information. But I find it hard to believe that no one has tried to use JTAG (e.g. to debug drivers or kernel).

Is anyone able to at least confirm that the steps referred on the Hikey960 documentation (to apply “01” to the JTAG_SEL pins) are still valid on the Hikey970?

To apply this “01” sequence, we should solder two wires on the referred test points? Or this should be done in another way?

Anyone knows where are these test points physically located on the baord? I’ve tried but couldn’t find them.

Thank you.


#3

I’ve not tried JTAG on either board but… I understand from my e-mail archive that if you’re using an FTDI/openocd stack on hikey960 you need srst_push_pull to get things to come alive. No idea what the equivalent setting is called for J-Link (or if this is also true to hikey970).