Fix duplicate timer channels on FURYF4OSD and WARPF7 - #11874
sensei-hacker wants to merge 2 commits into
Conversation
PB10 was declared TIM2_CH3 and PB11 TIM2_CH4, the same compare registers already driving S4_OUT (PA2) and S1_OUT (PA3). Two pins on one compare register can only emit the same waveform, so neither pad could ever be an independent output for any protocol, and at motorCount >= 5 the extra entries fight S1/S4 for their CCRs. Per the STM32F405 datasheet AF table PB10's only timer function is TIM2_CH3 and PB11's only timer function is TIM2_CH4, so there is no free channel to remap them to; both pads are also this board's UART3 TX/RX. MAX_PWM_OUTPUT_PORTS drops to the 4 outputs that remain.
S6 (PC8) was declared TIM3_CH3, the compare register already driving S1 (PB0), so S6 could only ever mirror S1 and was never usable as its own output. PC8 also reaches TIM8_CH3, which no other output on this board uses, so S6 moves there and the documented eight outputs all work. S4 (PB11) additionally moves to the second DMA option for TIM2_CH4, DMA1 Stream6. Its default, Stream7, is the only stream TIM3_CH3 can use, so S1 claimed it first and S4 went dead at four motors.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix duplicate timer channels on FURYF4OSD and WARPF7
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships |
|
RAM / Flash usage vs. base commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #11874 245 targets built. Find your board's
|
Summary
Two targets declare the same
(timer, channel)on two different pins. Both pins are then muxed to one compare register, so they can only ever emit the same waveform — the second pad is not an independent output for any protocol, DSHOT or otherwise, and at higher motor counts the two entries fight over the same CCR.A sweep of all 249 targets found these were the only two affected. After this PR that bucket is empty.
Changes
FURYF4OSD — PB10/PB11 removed
TIM2_CH3was declared on both PA2 (S4_OUT) and PB10;TIM2_CH4on both PA3 (S1_OUT) and PB11.Per the STM32F405 datasheet AF table, PB10's only timer function is
TIM2_CH3(AF1) and PB11's only timer function isTIM2_CH4(AF1) — there is no free channel to remap them to, so the twoTIM_USE_ANYentries are removed. Both pads are this board's UART3 TX/RX.MAX_PWM_OUTPUT_PORTSdrops 6 → 4 to match the outputs that remain.User-visible: FURYF4OSD advertises 4 outputs instead of 6. Outputs 5 and 6 never worked as independent outputs, so nothing that previously functioned is lost.
WARPF7 — S6 moved to TIM8_CH3
TIM3_CH3was declared on both PB0 (S1) and PC8 (S6), so S6 could only mirror S1. PC8 also reachesTIM8_CH3, which no other output on this board uses (DEF_TIM_AF__PC8__TCH_TIM8_CH3already exists intimer_def_stm32f7xx.h), so S6 moves there. The board keeps all eight documented outputs.Also in this file: S4 (PB11,
TIM2_CH4) moves to its second DMA option, DMA1 Stream6. Its default Stream7 is the only streamTIM3_CH3can use, so S1 claimed it first and S4 silently died at four motors. #11803 makes this same change onmaintenance-10.x;release/9.1does not have it.Testing
pwm_mapping.c's algorithm across motor counts 1–8: WARPF7 is now hazard-free at every count; FURYF4OSD reports no remaining duplicate or motor-vs-motor collision.DEF_TIMin both files re-validated against the STM32F405/F722 datasheet AF tables.Notes
Pre-existing and not addressed here: FURYF4OSD's S3_OUT (
TIM3_CH4, DMA1 Stream2) and LED strip (TIM5_CH1, DMA1 Stream2) share a stream, so the LED strip does not light when S3 uses DSHOT. Each channel has exactly one DMA option and PA0 has no other usable timer, so it cannot be fixed by remapping. Documented in #11803.This PR touches lines that #11803 annotates with comments; whichever merges second will need a trivial comment-level conflict resolution.