-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
NuttX enable SPI DMA per board #12436
Conversation
17eb2b7
to
4c209bd
Compare
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.
Did you check all the DMAMAPs to ensure there was no overlap burred in a nuttx driver?
The 512 and 1024 magic number are not helpful and do not tie to the granularity of the allocator. How about define the block size and add a comment to describe the limitations.
What is the formula for changing the BOARD_DMA_ALLOC_POOL_SIZE ? Can it be driven from the defconfig?
d6c6646
to
eacae78
Compare
Tested on PixRacer V4: Modes Tested Procedure Note: Logs: https://review.px4.io/plot_app?log=e48ab5c9-1a1d-4095-be23-23e55a800ef4 Logs: Comparison to master https://review.px4.io/plot_app?log=b7466023-f8d2-4366-83b6-d4cef75e549f Tested on Pixhawk 2 Cube V3: Modes Tested Procedure Note: Logs: https://review.px4.io/plot_app?log=f467fd1d-c1ae-447a-ac57-815f05f02cfe Logs: Comparison to master |
Tested on Pixhawk4 v5 f-450 |
Tested on Pixhawk 4 Mini V5:Modes Tested: Notes: Log: Tested on Pixhawk Pro v4:Modes Tested:
Procedure: Notes: Logs:
Tested on NXP FMUK66 v3:Modes Tested:
Procedure: Notes: Logs: |
Added holybro/kakutef7 to the list. |
6bc8c50
to
b1d6225
Compare
This is currently a problem on stm32f7 with the DCACHE and DMA capable check where the SPI transfer buffer is being incorrectly considered non-DMA capable if it's not sized as a cache line multiple. |
Why don't we just add a check to ensure we always allocate the right amount + padding to get us to the multiple of 4 bytes The SPI transfer can still just use the actual size of the data it wants. i.e
|
The problem is the DCACHE alignment check for the buffer end within NuttX. On stm32f7 spi_exchange() is checking if the buffer is DMA capable. The DMA capable check includes the buffer end. |
So all DMA spi transfers must be multiples of 4 bytes? That seems wrong. |
Yes, the check in its current form is bogus.
One idea David and I have discussed is to change the notion of "DMA capable" within NuttX, possibly similar to the DMA allocator we have in PX4. Then instead of the DMA capable checking memory range, etc it would be based on originating from this particular allocator. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
I suppose I should leave these branches around 🤷♂️. |
auav/esc35-v1bitcraze/crazyflienxp/fmuk66-v3px4/cannode-v1px4/esc-v1px4/io-v2thiemar/s2740vc-v1