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

rtt: fix hang when aux serial not read #1625

Merged
merged 1 commit into from
Sep 18, 2023
Merged

rtt: fix hang when aux serial not read #1625

merged 1 commit into from
Sep 18, 2023

Conversation

koendv
Copy link
Contributor

@koendv koendv commented Sep 18, 2023

Detailed description

This PR silently drops rtt output if the aux serial is unresponsive for 10ms.
Fixes #1488 RTT output hangs the BMP when not read by host.
Tested on blackpill-f411.

A more general solution would be to append the output of usb serial, traceswo decode, rtt, and redirect_stdout to a single circular buffer, and use the usb tx interrupt to trigger usb writes.

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

fixes #1488

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.

We've got one query, but other than that this looks good. Once the query's been answered and any required actions resulting taken, we'll happily approve this for merge.

src/platforms/common/stm32/rtt_if.c Outdated Show resolved Hide resolved
@dragonmux dragonmux added this to the v1.10 milestone Sep 18, 2023
@dragonmux dragonmux added Bug Confirmed bug BMP Firmware Black Magic Probe Firmware (not PC hosted software) labels Sep 18, 2023
@koendv
Copy link
Contributor Author

koendv commented Sep 18, 2023

OK. Let's set the aux serial write timeout to 25ms.
I prefer not to set the timeout too high, else if rtt is active and the usb aux serial is not being read, bmp might spend too much time busy-waiting.

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.

Sounds good, and LGTM. Merging once the builds finish.

@dragonmux dragonmux merged commit 42f4a29 into blackmagic-debug:main Sep 18, 2023
6 checks passed
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.

RTT output hangs the BMP when not read by host
2 participants