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

Feature: blackpill-f4 better control of pin mode #2044

Merged

Conversation

ALTracer
Copy link
Contributor

@ALTracer ALTracer commented Jan 7, 2025

Detailed description

  • For this board, this is a new feature (from other boards).
  • The existing problems are TRST unused and SWCLK always driven.
  • The PR solves them by initializing TRST_PIN in output open-drain pull-up mode, and implementing platform_target_clk_output_enable() which switches SWCLK/SWDIO to inputs or outputs.

This should allow keeping multiple BMPs wired up to a single target for cross-testing etc. and should prevent drive fight with low pin count chips like STM32G030J6 (I don't have one) or which remap their PA13/14 to output mode otherwise. No known shields/carriers/mainboards exist for it which have directional buffers and TCK_OEn aka TCK_DIR_PIN -- it would need similar treatment.
TRST pin high is required to even scan Raspberry Pi 3B (BCM2837), otherwise its TAP is disabled (default weak pull-down).

Pending testing on blackpill-f411ce.

Your checklist for this pull request

Closing issues

Fixes #1868 point 3 for this board.

dragonmux
dragonmux previously approved these changes Jan 7, 2025
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.

This LGTM and brings the platform up to parity with a couple of the others 👍🏼, merging. Thank you for the contribution!

@dragonmux dragonmux added this to the v2.0 release milestone Jan 7, 2025
@dragonmux dragonmux added Enhancement General project improvement HwIssue Mitigation Solving or mitigating a Hardware issue in Software Foreign Host Board Non Native hardware to runing Black Magic firmware on and removed HwIssue Mitigation Solving or mitigating a Hardware issue in Software labels Jan 7, 2025
* Pulling up TRST is required to scan Raspberry Pi 3B (BCM2837) and other JTAG targets
* jtagtap.c will gpio_clear() it if available
* Prevent drive fight with G030J6
* Allow multiple debuggers on same target without detaching this one
* Directional buffers will need an extra pin
@dragonmux dragonmux merged commit ab6d92e into blackmagic-debug:main Jan 8, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement General project improvement Foreign Host Board Non Native hardware to runing Black Magic firmware on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Platform behaviour unification (wrt VTref, GPIOs, DFU)
2 participants