Skip to content

AEDROXH7: fix LED strip DMA conflict with motor outputs#11629

Merged
sensei-hacker merged 1 commit into
iNavFlight:release/9.1from
sensei-hacker:add-target-aedroxh7-v2
Jun 7, 2026
Merged

AEDROXH7: fix LED strip DMA conflict with motor outputs#11629
sensei-hacker merged 1 commit into
iNavFlight:release/9.1from
sensei-hacker:add-target-aedroxh7-v2

Conversation

@sensei-hacker
Copy link
Copy Markdown
Member

Problem

The LED strip entry in target.c used dmavar=0:

DEF_TIM(TIM2, CH1, PA5, TIM_USE_LED, 0, 0),  // LED strip

On STM32H7, dmavar is a flat index into a 16-entry list of all DMA streams (DMA1 S0–S7 at indices 0–7, DMA2 S0–S7 at indices 8–15). Index 0 selects DMA1 Stream 0, which is already claimed by M1 (TIM8_CH2, also dmavar=0).

When DSHOT is active, motor DMA streams are allocated before the LED strip initialises. By the time ws2811LedStripInit() runs, DMA1 S0 is already owned, causing ledConfigureDMA() to silently return false — the LED strip never initialises.

This explains why the issue was not caught during initial testing: if tested without DSHOT active, DMA1 S0 is still free when the LED strip initialises and everything appears to work.

Fix

Change dmavar from 0 to 8 (DMA2 Stream 0), moving the LED strip off the motor DMA bank:

DEF_TIM(TIM2, CH1, PA5, TIM_USE_LED, 0, 8),  // LED strip

This matches the pattern used by other H7 targets (MATEKH743, MAMBAH743, FOXEERH743, BROTHERHOBBYH743 all use dmavar=8 or 9 for their LED strip entries).

Testing

Verified on hardware with DSHOT active — LED strip operates correctly after this fix.

dmavar=0 maps to DMA1 Stream 0, which is already claimed by M1 (TIM8_CH2).
When DSHOT is active, the LED strip silently fails to initialize because
its DMA stream is already owned. Change to dmavar=8 (DMA2 Stream 0),
matching the pattern used by other H7 targets (MATEKH743, MAMBAH743, etc.).
@qodo-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 7, 2026

Test firmware build ready — commit 511a3cf

Download firmware for PR #11629

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 5fa50d4 into iNavFlight:release/9.1 Jun 7, 2026
27 checks passed
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