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: Remote protocol target communications initialisation #1629

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

dragonmux
Copy link
Member

Detailed description

This PR seeks to address a crash-inducing bug reported by ALTracer on Discord. Under certain conditions during failed communications with a target over the remote protocol, dp->error() is called and the remote protocol layer in the firmware was improperly initialising the faked DP structure it uses, resulting in an attempted call through a NULL function pointer.

This patch addresses this problem for both JTAG and SWD over remote protocol + documents that structure a bit to help prevent future problems.

Tested by ALTracer against the STM32MP157 with which this bug was found and triggered.

This bug has existed in the firmware since about 3 years ago and does affect v1.7, v1.8 and v1.9 - we may wish to backport it at least to v1.9 because of this.

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)
  • 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

@dragonmux dragonmux added Bug Confirmed bug BMP Firmware Black Magic Probe Firmware (not PC hosted software) labels Sep 25, 2023
@dragonmux dragonmux added this to the v1.10 milestone Sep 25, 2023
@dragonmux dragonmux requested a review from esden September 25, 2023 16:12
Copy link
Member

@esden esden left a comment

Choose a reason for hiding this comment

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

LGTM, also I think it is a good idea to backport this to the previous firmware branches.

@esden esden merged commit 4da527b into main Sep 27, 2023
6 checks passed
@dragonmux dragonmux deleted the fix/remote-target-comms-init branch September 27, 2023 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BMP Firmware Black Magic Probe Firmware (not PC hosted software) Bug Confirmed bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants