backport: jtag/drivers: add T-Head CK-Link JTAG adapter driver - #80
Open
will-tm wants to merge 1 commit into
Open
backport: jtag/drivers: add T-Head CK-Link JTAG adapter driver#80will-tm wants to merge 1 commit into
will-tm wants to merge 1 commit into
Conversation
Driver for T-Head CK-Link Lite V2 probes, including the Bouffalo Lab
BL616/BL702 CK-Link clones used as built-in debuggers on BL61x/BL70x
evaluation boards. The wire protocol is a framed command format over
USB bulk endpoints, reverse-engineered from T-Head's DebugServer.
Implements JTAG_SCAN via the probe's batch opcode, with IR caching
across execute_queue boundaries and end-of-queue flush so OpenOCD's
Capture-IR validation reads real hardware data. Speed is programmable
(freq_kHz = 48000 / (N+1), capped at the DebugServer-validated 2526
kHz). Probes are matched against a built-in VID/PID list and by
adapter serial.
Known protocol limitations, surfaced as one-time warnings:
- Single batch entry encodes IR/DR bit-counts in single bytes;
scans > 255 bits are clamped with TDI pass-through on the
un-shifted portion.
- The T-Head DTM's Capture-IR returns the current IR value rather
than the IEEE 1149.1 'xxx01' pattern; init pre-loads IR = IDCODE.
- No TMS-sequence opcode: JTAG_TMS and JTAG_PATHMOVE return
ERROR_JTAG_NOT_IMPLEMENTED.
- Multi-TAP chains are not supported.
- RTCK is not supported.
Tested against BL618 and BL702 evaluation boards.
Adapted for the Zephyr OpenOCD fork: uses .transports string array
instead of .transport_ids, and the 4-argument jtag_libusb_open()
signature (serial matching handled internally by libusb_helper).
Backport of:
https://review.openocd.org/c/openocd/+/9586
Signed-off-by: William Markezana <william.markezana@gmail.com>
will-tm
force-pushed
the
backport/cklink-driver
branch
from
May 18, 2026 15:21
5700896 to
9777f42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Driver for T-Head CK-Link Lite V2 probes, including the Bouffalo Lab BL616/BL702 CK-Link clones used as built-in debuggers on BL61x/BL70x evaluation boards. The wire protocol is a framed command format over USB bulk endpoints, reverse-engineered from T-Head's DebugServer.
Implements JTAG_SCAN via the probe's batch opcode, with IR caching across execute_queue boundaries and end-of-queue flush so OpenOCD's Capture-IR validation reads real hardware data. Speed is programmable (freq_kHz = 48000 / (N+1), capped at the DebugServer-validated 2526 kHz). Probes are matched against a built-in VID/PID list and by adapter serial.
Known protocol limitations, surfaced as one-time warnings:
Tested against BL618 and BL702 evaluation boards.
Adapted for the Zephyr OpenOCD fork: uses .transports string array instead of .transport_ids, and the 4-argument jtag_libusb_open() signature (serial matching handled internally by libusb_helper).
Backport of:
https://review.openocd.org/c/openocd/+/9586