Kendryte K210 / MaixDock, OpenOCD / J-Link Incorrect ID

Hi,

I have been trying to setup a J-Link Pro JTAG adaptor with the MaixDock development board and the openocd-kendryte package from https://github.com/kendryte/openocd-kendryte.

If I run openocd I get the following error:

kendryte-openocd$ ./openocd -f ./kendryte.cfg -m0
 _  __              _            _
| |/ /___ _ __   __| |_ __ _   _| |_ ___
| ' // _ \ '_ \ / _` | '__| | | | __/ _ \
| . \  __/ | | | (_| | |  | |_| | ||  __/
|_|\_\___|_| |_|\__,_|_|   \__, |\__\___|
                           |___/
Kendryte Open On-Chip Debugger For RISC-V v0.2.3 (2019-02-21)
Licensed under GNU GPL v2
adapter speed: 30 kHz
Info : J-Link V10 compiled Oct  5 2020 14:56:16
Info : Hardware version: 10.10
Info : VTarget = 3.348 V
Info : clock speed 30 kHz
Info : JTAG tap: riscv.cpu tap/device found: 0x82723cb5 (mfg: 0x65a (<unknown>), part: 0x2723, ver: 0x8)
Warn : JTAG tap: riscv.cpu       UNEXPECTED: 0x82723cb5 (mfg: 0x65a (<unknown>), part: 0x2723, ver: 0x8)
Error: JTAG tap: riscv.cpu  expected 1 of 1: 0x04e4796b (mfg: 0x4b5 (<unknown>), part: 0x4e47, ver: 0x0)
Error: Trying to use configured scan chain anyway...
Error: riscv.cpu: IR capture error; saw 0x10 not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Unsupported DTM version 11. (dtmcontrol=0x4e4796b)
Info : Listening on port 3333 for gdb connections

Interestingly, the device ID found is exactly the same as the expected one, but circularly shifted right by one bit:

>>> "{0:032b}".format(0x04e4796b)
'00000100111001000111100101101011'
>>> "{0:032b}".format(0x82723cb5)
'10000010011100100011110010110101'

I have tried all of the earlier releases of the openocd-kendryte package with the same problem.

I have tried reducing the JTAG clock speed down from 3000 Khz down to 1 KHz with the same problem.

I have tried building the upstream riscv-openocd from source with the same problem.

I have connected the regular JTAG pins correctly. Removing any of the pins causes the detection to fail without finding an ID at all.

Has anyone got any thoughts about this?

Quick update: I purchased a Seedstudio FTDI based debugger and it worked perfectly.

It appears that the issue is with the J-Link Pro.