Skip to content

fix(t22): use PB15 and PJ12 for red LED due to USART1_RX DFU overlap - #7542

Merged
pfeerick merged 1 commit into
mainfrom
3djc/fix-t22-dfu-flash
Jul 10, 2026
Merged

fix(t22): use PB15 and PJ12 for red LED due to USART1_RX DFU overlap#7542
pfeerick merged 1 commit into
mainfrom
3djc/fix-t22-dfu-flash

Conversation

@3djc

@3djc 3djc commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes #7534 (or at least support the required hardware change, technical details in the issue itself)

Summary of changes:

To fix an issue of buddy been unable to flash T22, there needs to be an hardware change. Red led pin will be moved from the troublemaking PB15 in current T22 boards to PJ12 in future boards.

This software change supports the red led operation for both old and new boards (old still remains non buddy flashable)

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a second red LED GPIO (LED_RED2_GPIO) for the T22 target, defined as GPIOJ pin 12, and wires it into the shared LED driver's initialization, off, and red-on functions alongside the existing red LED.

Changes

Second Red LED GPIO Support

Layer / File(s) Summary
LED_RED2_GPIO macro definition
radio/src/targets/t22/hal.h
Adds a new macro mapping LED_RED2_GPIO to GPIO_PIN(GPIOJ, 12).
LED driver wiring for second red LED
radio/src/boards/generic_stm32/led_driver.cpp
ledInit(), ledOff(), and ledRed() are updated to conditionally initialize, clear, and set LED_RED2_GPIO alongside the existing red LED GPIO.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The GPIO/LED compatibility update matches the T22 flashing issue's hardware workaround and keeps both board variants supported.
Out of Scope Changes check ✅ Passed The changes are limited to the T22 LED driver and GPIO definition, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly matches the main change: T22 red LED GPIO mapping updated for old and new boards.
Description check ✅ Passed The description follows the template with a Fixes reference and a summary of the hardware-compatibility change.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 3djc/fix-t22-dfu-flash

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@3djc 3djc added hardware support backport/2.12 To be backported to a 2.12 release also. labels Jul 9, 2026
@pfeerick pfeerick added this to the 2.12.3 milestone Jul 10, 2026
@pfeerick pfeerick changed the title fix(t22): Allow both PB15 and PJ12 to be used as red led for T22 fix(t22): use PB15 and PJ12 for red LED due to USART1_RX DFU overlap Jul 10, 2026
@pfeerick

Copy link
Copy Markdown
Member

Ouch! Well, at least you can still do UF2 :-O

@pfeerick
pfeerick merged commit 7f228ff into main Jul 10, 2026
40 checks passed
@pfeerick
pfeerick deleted the 3djc/fix-t22-dfu-flash branch July 10, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/2.12 To be backported to a 2.12 release also. hardware support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T22 cannot be flashed with buddy or rdfu in DFU mode

2 participants