-
Notifications
You must be signed in to change notification settings - Fork 204
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
[DNM] Px4 firmware nuttx 10.3.0+ serial fixes testing #285
base: px4_firmware_nuttx-10.3.0+
Are you sure you want to change the base?
[DNM] Px4 firmware nuttx 10.3.0+ serial fixes testing #285
Conversation
This also solves the original problem, however, to make a more informed decision, I'm currently working of a DMA tracer to check the timing differences between these changes. |
Ok, so I have three trace files from FMUv6x (STM32H7) which you can all drag into ui.perfetto.dev to check for yourself.
Some observations on DMA2 CH4, which is services an unconnected TELEM1:
You can also see this in the summary view:
I instrumented the dma_disable, dma_setup, dma_interrupt, dma_start functions for this. Some of them are called in an interrupt context (so very fast), others from threads (when they wake up). That would explain why the transfers in 2 take "longer". Perhaps there is a better, tighter way to instrument this though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, at least on STM32H7, this fixes the problem by removing the semaphore altogether and it schedules the next DMA transfer once the previous one has finished. Timing suggests similar throughput as before (if the transmit thread has a high priority).
@niklaut - Thank you for validating. I have the H7 change in a PR upstream and will backport it once merged. I will continue in this PR the NXP changes. |
This prevents dma stop operations called of a completion call back from rentering, the callback and ensures that the call back will see the idle state.
Fixes stuttering output. The use of the semaphore was causing blocking on non blocking callers. This ensured that the TX DAM would be restated, but when it was switched to trywait in 8362e31, it left data in the xmit queue unsent. This solution removes the semaphore and restart the DMA on completion if there is more data in the xmit queue to be sent.
7efbc08
to
fcf6a09
Compare
The H7 fix c696d5e needs further testing from @niklaut etal. see
The other commits needs to be replicated to all NXP SoC's DMA, and serial and then unstreamed and back ported.