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

Timer DMA burst #9265

Merged
merged 4 commits into from
Sep 1, 2023
Merged

Timer DMA burst #9265

merged 4 commits into from
Sep 1, 2023

Conversation

shirase
Copy link
Contributor

@shirase shirase commented Aug 28, 2023

Some FC, like SPEEDYBEEF405V3 do not have enouth DMA channels for timers. And some motors not works on DSHOT.
This PR fix it, by using dma burst mode. It need only one DMA channel for four timer channels.

@DzikuVx
Copy link
Member

DzikuVx commented Aug 30, 2023

Wow! Amazing! Let me test in a next few day! Thank you very much @shirase

@DzikuVx DzikuVx added this to the 7.0 milestone Aug 30, 2023
@DzikuVx DzikuVx added the Release Notes Add this when a PR needs to be mentioned in the release notes label Aug 30, 2023
@shirase
Copy link
Contributor Author

shirase commented Aug 30, 2023

It must work on all F4 targets.
Activated by: #define USE_DSHOT_DMAR

@mmosca
Copy link
Collaborator

mmosca commented Aug 30, 2023

This will certainly decrease the number of users asking about this in the future :)

@Jetrell
Copy link

Jetrell commented Aug 30, 2023

It must work on all F4 targets. Activated by: #define USE_DSHOT_DMAR

Very nice. I assume this should be a good fix for the Matek F405miniTE as well ?

@rmaia3d
Copy link
Contributor

rmaia3d commented Aug 30, 2023

It must work on all F4 targets. Activated by: #define USE_DSHOT_DMAR

Very nice. I assume this should be a good fix for the Matek F405miniTE as well ?

I was going to ask the very same thing! :)

@shirase
Copy link
Contributor Author

shirase commented Aug 31, 2023

Very nice. I assume this should be a good fix for the Matek F405miniTE as well ?

I do not have that board. Can someone test it?

@shirase
Copy link
Contributor Author

shirase commented Aug 31, 2023

Added HAL library implementation. Now it can be used for all targets. Need to be tested.

@DzikuVx
Copy link
Member

DzikuVx commented Sep 1, 2023

Tested with SPDBF405V3 and regular MatekF722 and everything seems to work fine.. If something is broken, we will find out what is it later :)

@DzikuVx
Copy link
Member

DzikuVx commented Sep 1, 2023

Thank you very much much @shirase

@DzikuVx DzikuVx merged commit a9e2c59 into iNavFlight:master Sep 1, 2023
14 checks passed
@MATEKSYS
Copy link
Contributor

MATEKSYS commented Sep 2, 2023

Thanks for adding DMAR support. Tested with MatekF405TE target, S3 on TIM1_CH3N still doesn't work.
seems CH'N" support is a legacy bug . With betaflight fw, TIM1_CH3N works fine with normal DMA2_ST6, also works normal with DMA burst.

Betaflight, dshot_burst = OFF

DMA1 Stream 0: FREE
DMA1 Stream 1: FREE
DMA1 Stream 2: FREE
DMA1 Stream 3: SPI_MISO 2
DMA1 Stream 4: SPI_MOSI 2
DMA1 Stream 5: FREE
DMA1 Stream 6: FREE
DMA1 Stream 7: FREE
DMA2 Stream 0: SPI_MISO 1
DMA2 Stream 1: MOTOR 4
DMA2 Stream 2: MOTOR 2
DMA2 Stream 3: SPI_MOSI 1
DMA2 Stream 4: ADC 1
DMA2 Stream 5: FREE
DMA2 Stream 6: MOTOR 3
DMA2 Stream 7: MOTOR 1

Betaflight, dshot_burst = ON

DMA1 Stream 0: FREE
DMA1 Stream 1: FREE
DMA1 Stream 2: FREE
DMA1 Stream 3: SPI_MISO 2
DMA1 Stream 4: SPI_MOSI 2
DMA1 Stream 5: FREE
DMA1 Stream 6: FREE
DMA1 Stream 7: FREE
DMA2 Stream 0: SPI_MISO 1
DMA2 Stream 1: TIMUP 8
DMA2 Stream 2: FREE
DMA2 Stream 3: SPI_MOSI 1
DMA2 Stream 4: ADC 1
DMA2 Stream 5: TIMUP 1
DMA2 Stream 6: FREE
DMA2 Stream 7: FREE

rmaia3d pushed a commit to rmaia3d/inav that referenced this pull request Sep 9, 2023
@rmaia3d rmaia3d mentioned this pull request Sep 19, 2023
@rmaia3d
Copy link
Contributor

rmaia3d commented Sep 27, 2023

As mentioned in #9276, this PR apparently broke DShot beeper on all targets. Reverting it, makes DShot beeper work again even in targets that don't use the DMA burst mode.

@shirase
Copy link
Contributor Author

shirase commented Sep 27, 2023

It works fine on DSHOT600. DSHOT300 - beeper not work. I will make fix.

@shirase shirase mentioned this pull request Sep 28, 2023
rmaia3d added a commit to rmaia3d/inav that referenced this pull request Oct 2, 2023
@sensei-hacker
Copy link
Collaborator

Are there disadvantages to using this?
Is it okay to use it fairly liberally as needed, or are there drawbacks?

@shirase
Copy link
Contributor Author

shirase commented Aug 15, 2024

It can be used everywhere. But need tests for different boards. Do not enable if you do not have board for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants