Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Fix: platforms/blackpill-f4: invert state of SET_IDLE_STATE#1645

Merged
dragonmux merged 1 commit intoblackmagic-debug:mainfrom
lenvm:fix/blackpill-f4-invert-led-idle-logic
Oct 18, 2023
Merged

Fix: platforms/blackpill-f4: invert state of SET_IDLE_STATE#1645
dragonmux merged 1 commit intoblackmagic-debug:mainfrom
lenvm:fix/blackpill-f4-invert-led-idle-logic

Conversation

@lenvm
Copy link
Contributor

@lenvm lenvm commented Oct 17, 2023

Detailed description

This pull request fixes the issue that LED_IDLE_RUN is not working on the blackpill-f4 platforms when it is assigned to PC13, the onboard LED. The issue is caused by the need to set PC13 to low to turn the LED on, rather than to set PC13 to high to turn the LED on.
The root cause of this is the schematic of how the LED is connected to PC13:
3.3v -> R 1k -> Blue LED -> PC13 (reference).

This pull request fixes the issue described, by inverting the state used by for SET_IDLE_STATE. This results in setting PC13 to low when the state is true, and PC13 to high when the state is false. This is exactly the behavior needed to turn the LED on when the state is true.

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

This issue is a partial fix to #1516

@lenvm
Copy link
Contributor Author

lenvm commented Oct 18, 2023

@dragonmux, as this is a fix for an existing issue with the blackpill-f4 platforms, can it also be included in the v1.10.0 release?

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.

Good catch! Given how simple this fix is, and how low risk, we're going to merge this as part of v1.10.0.

@dragonmux dragonmux added this to the v1.10 milestone Oct 18, 2023
@dragonmux dragonmux added Bug Confirmed bug Foreign Host Board Non Native hardware to runing Black Magic firmware on labels Oct 18, 2023
@dragonmux dragonmux merged commit 643106f into blackmagic-debug:main Oct 18, 2023
@lenvm lenvm deleted the fix/blackpill-f4-invert-led-idle-logic branch October 18, 2023 20:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Bug Confirmed bug 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.

2 participants