Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Fix JTAG sanity check in BYPASS device counting - #2178

Merged
dragonmux merged 1 commit into
blackmagic-debug:mainfrom
ALTracer:fix/jtag-bypass-count
Jan 26, 2026
Merged

Fix JTAG sanity check in BYPASS device counting#2178
dragonmux merged 1 commit into
blackmagic-debug:mainfrom
ALTracer:fix/jtag-bypass-count

Conversation

@ALTracer

@ALTracer ALTracer commented Jan 24, 2026

Copy link
Copy Markdown
Contributor

Detailed description

  • This is not a new feature.
  • The existing problem is an error triggered in BMD logic for chips which are debuggable by OpenOCD using same adapteres.
  • The PR solves it by ensuring DR value is predictable.

jtag_scan: Sanity check failed: BYPASS dev count doesn't match IR scan
Not tested yet. The error/warning demotion will be rebased away once I confirm the solution works.
Upd: tested to improve the situation, the chip in question became scannable by BMF. Sanity check restored.

Your checklist for this pull request

Closing issues

@ALTracer
ALTracer force-pushed the fix/jtag-bypass-count branch 3 times, most recently from 50aef39 to 177362b Compare January 26, 2026 16:02
@ALTracer

Copy link
Copy Markdown
Contributor Author

Logs with a FT2232H-attached board (unsupported) on this branch. Please state whether I should keep or discard the jtag_scan: DR=1 by default in BYPASS message, which confirms such chips exist.

$ ./build/blackmagic -tjv 1 -c ftdijtag
Black Magic Debug App v2.0.0-304-g11bd1f2c
 for Black Magic Probe, ST-Link v2 and v3, CMSIS-DAP, J-Link, FTDI (MPSSE) and WCH-Link
Using 0403:6010 <no serial number> FTDI
 Dual RS232-HS ---
Running in Test Mode
Target voltage: Unknown
Speed set to 3.750MHz for JTAG
Resetting TAP
Change state to Shift-DR
Scanning out ID codes
Return to Run-Test/Idle
Change state to Shift-IR
Scanning out IRs
Return to Run-Test/Idle
Change state to Shift-DR
jtag_scan: DR=1 by default in BYPASS
Return to Run-Test/Idle
ID code 0x000006df: Unknown
Given target number 1 not available max 0

@dragonmux

Copy link
Copy Markdown
Member

You've been able to prove the purpose of this PR with that message but we don't think it adds anything to scans more generally, so please drop the extra logging message.

@ALTracer
ALTracer force-pushed the fix/jtag-bypass-count branch from 177362b to 54ddc35 Compare January 26, 2026 16:17

@dragonmux dragonmux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, merging - thank you for this fix to the BYPASS check so it's more correct and doesn't kick out devices that start with their DR BYPASS bit set to 1 after reset or previous scan.

@dragonmux dragonmux added this to the v2.1 release milestone Jan 26, 2026
@dragonmux dragonmux added the Bug Confirmed bug label Jan 26, 2026
@dragonmux
dragonmux merged commit 54ddc35 into blackmagic-debug:main Jan 26, 2026
37 of 39 checks passed
@ALTracer
ALTracer deleted the fix/jtag-bypass-count branch February 21, 2026 21:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Bug Confirmed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants