Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: honor capability bits of legacy J-Link V5 probes #1623

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

ALTracer
Copy link
Contributor

Detailed description

Add support for older J-Link V5 adapters to BMDA.
OEM considers these "legacy" https://wiki.segger.com/J-Link_BASE_V5_or_lower , in fact everything pre-V11.
IMO these are still okay for raw sequences and "accelerated bit-banging" of conventional good old JTAG, fixed-direction bus transceivers included.

  • This does not look like a new feature.
  • Current Blackmagic Hosted App crashes V5 hardware (2008 firmware) adapters (but works with JLink V8 hw 2014 fw)
  • This pull request adds a few checks regarding "multiple interfaces" capability bits to keep BMDA+JLink V5 always in JTAG mode.

I tested this on V5.4 and V5.3 yellow "Kickstart" adapters from 2006 and now they at least work. Also tested on V8 (same AT91SAM7S64, more bus transceivers for bidirectional SWD), no regressions, both SWD & JTAG are accessible and working.
Code loosely follows similar checks from openocd+libjaylink, published UM08001 and aims to be a follow-up to #1548.
The firmware in question does not support 0xc7 "EMU_CMD_SELECT_IF" commands at all. I can remove irrelevant parts of in-code comments on request.

Your checklist for this pull request

  • I've read the Code of Conduct
  • I've read the guidelines for contributing to this repository
  • It builds for hardware native (make PROBE_HOST=native) -- not applicable
  • It builds as BMDA (make PROBE_HOST=hosted)
  • I've tested it to the best of my ability
  • My commit messages provide a useful short description of what the commits do

Closing issues

I would open an issue about this back in August, but instead I provide a suggested fix here.

Copy link
Contributor

@perigoso perigoso left a comment

Choose a reason for hiding this comment

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

LGTM, just a note on one bit of code style

src/platforms/hosted/jlink.c Show resolved Hide resolved
Copy link
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

Patch looks good. Dependant on perigoso's response to the review comment on the jlink_select_interface() change, LGTM to merge.

@dragonmux dragonmux merged commit 8d7d064 into blackmagic-debug:main Sep 14, 2023
6 checks passed
@dragonmux dragonmux added Bug Confirmed bug HwIssue Mitigation Solving or mitigating a Hardware issue in Software BMD App Black Magic Debug App (aka. PC hosted) (not firmware) labels Sep 14, 2023
@dragonmux dragonmux added this to the v1.10 milestone Sep 14, 2023
@ALTracer ALTracer deleted the jlink-tif-caps branch November 22, 2023 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BMD App Black Magic Debug App (aka. PC hosted) (not firmware) Bug Confirmed bug HwIssue Mitigation Solving or mitigating a Hardware issue in Software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants