Skip to content

BLUEBERRYF405: add missing PWM beeper timer entry for PB9#11531

Merged
sensei-hacker merged 1 commit intoiNavFlight:maintenance-9.xfrom
sensei-hacker:fix-pwm-beeper-mode-regression
May 3, 2026
Merged

BLUEBERRYF405: add missing PWM beeper timer entry for PB9#11531
sensei-hacker merged 1 commit intoiNavFlight:maintenance-9.xfrom
sensei-hacker:fix-pwm-beeper-mode-regression

Conversation

@sensei-hacker
Copy link
Copy Markdown
Member

@sensei-hacker sensei-hacker commented May 3, 2026

Summary

  • Adds the missing DEF_TIM(TIM11, CH1, PB9, TIM_USE_BEEPER, 0, 0) entry to BLUEBERRYF405/target.c
  • Without this entry, timerGetByTag() returns NULL for the beeper pin and beeperPwmInit() silently leaves beeperPwm = NULL, so beeper_pwm_mode = ON produces no sound
  • TIM11/CH1 is the correct assignment for PB9 on STM32F405 (confirmed against SKYSTARSF405WING reference target)

Fixes part of #11492 (beeper_pwm_mode regression in 9.x maintenance builds).

Note: A second root cause also exists for boards where the beeper timer entry is present but timer_output_mode is set to reassign that peripheral (e.g. MATEKH743 with timer_output_mode 1 SERVOS). That issue is in timerHardwareOverride() in pwm_mapping.c and is being handled separately.

Test plan

  • Build BLUEBERRYF405 target cleanly
  • Verify beeper_pwm_mode = ON produces tone on PB9 hardware
  • Confirm GPIO (non-PWM) beeper mode unaffected

TIM11/CH1 is the correct timer mapping for PB9 on STM32F405.
Without this DEF_TIM entry, beeperPwmInit() silently fails because
timerGetByTag(PB9, TIM_USE_BEEPER) returns NULL, leaving the beeper
non-functional when beeper_pwm_mode is enabled.

Fixes beeper_pwm_mode regression on this target. Same fix was
previously applied to BLUEBERRYH743 (commit a66b346).
@qodo-code-review
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

BLUEBERRYF405: Add missing PWM beeper timer entry

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Adds missing PWM beeper timer entry for PB9
• Fixes beeper_pwm_mode regression on BLUEBERRYF405 target
• Enables timerGetByTag() to locate beeper timer correctly
• Aligns with BLUEBERRYH743 fix (commit a66b346c)
Diagram
flowchart LR
  A["Missing DEF_TIM entry"] -->|"timerGetByTag returns NULL"| B["beeperPwmInit fails silently"]
  B -->|"beeperPwm stays NULL"| C["beeper_pwm_mode produces no sound"]
  D["Add TIM11 CH1 PB9 entry"] -->|"timerGetByTag finds timer"| E["beeperPwmInit succeeds"]
  E -->|"beeperPwm initialized"| F["beeper_pwm_mode works correctly"]
Loading

Grey Divider

File Changes

1. src/main/target/BLUEBERRYF405/target.c 🐞 Bug fix +1/-0

Add TIM11 beeper timer mapping for PB9

• Adds DEF_TIM(TIM11, CH1, PB9, TIM_USE_BEEPER, 0, 0) entry to timerHardware array
• Configures TIM11 channel 1 on pin PB9 for beeper PWM functionality
• Includes comment identifying the entry as beeper PWM configuration

src/main/target/BLUEBERRYF405/target.c


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Copy Markdown
Contributor

qodo-code-review Bot commented May 3, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

Test firmware build ready — commit 73d9e07

Download firmware for PR #11531

1 targets built. Find your board's .hex file by name on that page (e.g. MATEKF405SE.hex). Files are individually downloadable — no GitHub login required.

Development build for testing only. Use Full Chip Erase when flashing.

@sensei-hacker sensei-hacker merged commit c220198 into iNavFlight:maintenance-9.x May 3, 2026
9 checks passed
@sensei-hacker sensei-hacker added this to the 9.1 milestone May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant