Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix F411 PA10 Motor DMA Assignment #12561

Merged
merged 1 commit into from Apr 4, 2023

Conversation

ot0tot
Copy link
Contributor

@ot0tot ot0tot commented Mar 22, 2023

Timer-based DShot does not work on F411 FCs that use pin A10 as a motor output when DMA2 Stream 6 Channel 0 is used for TIM1_CH3. Moving the DMA assignment to DMA2 Stream 6 Channel 6 fixes the issue.

See: betaflight/unified-targets#961

@blckmn
Copy link
Member

blckmn commented Mar 22, 2023

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> FAIL
  • approver count at least three -> FAIL

@github-actions
Copy link

Do you want to test this code? Here you have an automated build:
Assets
WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!

@ctzsnooze
Copy link
Member

Usually we have bitbang set to auto on these FC's.
How does this change affect that setting?
What benefit does this change bring to the affected boards?

@ot0tot
Copy link
Contributor Author

ot0tot commented Mar 23, 2023

Usually we have bitbang set to auto on these FC's. How does this change affect that setting? What benefit does this change bring to the affected boards?

I believe DShot bitbang should be set to off on F411 FCs, as due to an errata it is incompatible with DMA on SPI1, which is usually used for the gyro (see:https://betaflight.com/docs/manufacturer/manufacturer-design-guidelines#3213-f4-resource-selection). Regardless, this change does not affect the bitbang settings, it only moves TIM1_CH3 to a different DMA channel in the same stream so that if DShot bitbang is disabled, timer-based DShot works as expected.

Without this change, timer-based DShot does not work on the motor assigned to pin A10, and it also seems to prevent the ADC from working (see troubleshooting discussion linked in the unified-targets PR). Thus a user would not be able to run bidirectional DShot on these FCs, and they would lose ADC functions such as voltage and current monitoring.

It's not clear to me why there is a difference between using channel 0 and channel 6 in this case, but if anyone has an idea I would love to hear it!

@blckmn blckmn merged commit 13feebe into betaflight:master Apr 4, 2023
18 checks passed
@ot0tot ot0tot deleted the Fix-F411-PA10-DMA-Assignments branch April 4, 2023 17:41
davidbitton pushed a commit to davidbitton/betaflight that referenced this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

None yet

4 participants