Fix silent motor/servo outputs from shared advanced-timer DMA request lines on 29 targets - #11815
Conversation
…quest lines TIM1/TIM8 CH1-CH3 on F4/F7 can select a per-channel dedicated DMA request line or a combined CH1/CH2/CH3 line shared with sibling channels. When a sibling is also genuinely driven, its compare events land on the shared line too and corrupt this channel's DSHOT transfer -- silently, with no boot error, same defect class as ab07785. Switches each affected channel to its dedicated dmavar option (or, on TMOTORF7, corrects the reverse case where the dedicated option was mistakenly picked per F4 convention on an F7 target whose header table orders them oppositely). BEEROTORF4 and DALRCF722DUAL have a genuine hardware DMA-topology conflict: two outputs whose only non-combined route is the identical physical DMA stream, so no dmavar choice can give both a private line. Kept the S1-S4 output (position < 4) clean in both cases; the other output was already broken before this change and remains so.
|
ⓘ 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 QodoAvoid shared TIM1/TIM8 DMA request lines to prevent silent DSHOT output loss
AI Description
Diagram
High-Level Assessment
Files changed (29)
|
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 turn these tips off under Display preferences |
|
RAM / Flash usage vs. base branch — commit
See RAM/flash optimization guide for techniques to reduce usage. |
|
Test firmware build ready — commit Download firmware for PR #11815 245 targets built. Find your board's
|
Summary
TIM1/TIM8 CH1-CH3 on F4/F7 can select either a per-channel dedicated DMA
request line or a combined CH1/CH2/CH3 line shared with sibling channels.
When a sibling channel is also genuinely driven, its compare events land on
the shared line too and corrupt this channel's DSHOT transfer -- silently,
with no boot-time error or CLI diagnostic. This is the same defect class
fixed once before upstream in
ab07785fa9("Fix channel selection for DMA2Stream6"), applied there to 4 targets. This PR fixes 29 more targets found
by a full-tree sweep.
Changes
Each target gets a one-line-per-channel
dmavarchange intarget.c,moving the affected channel(s) off the shared/combined DMA request line
onto their own dedicated one (or, on
TMOTORF7, the reverse correction --its F7 header table orders the dedicated/combined options oppositely from
F4's, and the existing value had picked the combined one by F4 convention).
Two targets could not be fully resolved:
BEEROTORF4andDALRCF722DUALeach have a pair of outputs whose only non-combined DMA route is the
identical physical DMA stream -- a genuine hardware DMA-topology conflict,
not fixable by any
dmavarchoice. In both cases the S1-S4 (basic-quad)output was kept clean; the other, already-broken output is unchanged.
Testing
pwm_mapping.crole-resolution and DMA-claim logic (motor-count sweep per target): every
target's
SHARED_TIMER_DMA_REQUESThazard clears (or, for the 2irreducible cases, only the non-S1-S4 output remains flagged), and no new
DMA_STREAM_COLLISION/SILENT_DEAD_MOTORhazard was introduced anywherein the sweep, on any of the 29 targets.
regression;
BEEROTORF4specifically improves from a CERTAIN hazard (anS1-S4 output actually dead) to NOTICE (only a non-critical output
affected).
directions, and both partial-fix cases (
AIKONF4,BEEROTORF4,TMOTORF7,DALRCF722DUAL,PIXRACER,FRSKYPILOT) -- all compiledcleanly with no warnings or memory-region overflows.
29 targets. The fix pattern is identical to the previously
hardware-confirmed
ab07785fa9fix, and is verified against the realDMA-routing option tables and the actual firmware role-resolution logic,
but the specific boards here have not been flight-tested with this
change. Flagging "Testing Required" for anyone with matching hardware to
confirm.
Related Issues
None filed; found via static analysis while investigating the
ab07785fa9defect class across the full target tree.