7
31
Fork
You've already forked blackmagic
23

Fix JTAG sanity check in BYPASS device counting #2178

Merged
ALTracer merged 1 commit from fix/jtag-bypass-count into main 2026年01月26日 17:47:19 +01:00
ALTracer commented 2026年01月24日 11:23:28 +01:00 (Migrated from github.com)
Copy link

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

## 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 * [x] I've read the [Code of Conduct](https://github.com/blackmagic-debug/blackmagic/blob/main/CODE_OF_CONDUCT.md) * [x] I've read the [guidelines for contributing](https://github.com/blackmagic-debug/blackmagic/blob/main/CONTRIBUTING.md) to this repository * [x] It builds for hardware native (see [Building the firmware](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-firmware)) * [x] It builds as BMDA (see [Building the BMDA](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app)) * [x] I've tested it to the best of my ability * [x] My commit messages provide a useful short description of what the commits do ## Closing issues
ALTracer commented 2026年01月26日 17:07:32 +01:00 (Migrated from github.com)
Copy link

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
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. ```c $ ./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 ```

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.

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.
dragonmux left a comment
Copy link

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.

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.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
BMD App
Black Magic Debug App (aka. PC hosted) (not firmware)
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Build system
Build system
Can't reproduce
Maintainers can't reproduce this problem
CI
Continuous Integration System
Contribution wanted
User contributions welcome
Documentation
Project documentation
Draft
Work in progress draft
Duplicate
This issue or pull request already exists
Enhancement
General project improvement
Feedback wanted
Requires additional submitter feedback
Foreign Host Board
Non Native hardware to runing Black Magic firmware on
GDB
Issue/PR related to GDB
Good first issue
Good for newcommers
HwIssue Mitigation
Solving or mitigating a Hardware issue in Software
Information Needed
Maintainers need more information
NativeHardware
Official Black Magic Debug Hardware
New Host Board
New hardware to run Black Magic firmware on
New Target
New debug target
Off Topic
Something that does not involve the project in any way
Potential Bug
A potential, unconfirmed or very special circumstance bug
Regression
Bug caused by a regression
User Interest Needed
More user interest required before consideration
User Testing Needed
Looking for user testing reports
Won't fix
Outside of the project scope or works as intended
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/blackmagic!2178
Reference in a new issue
blackmagic-debug/blackmagic
No description provided.
Delete branch "fix/jtag-bypass-count"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?