You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/11/28 15:25:16 UTC

[GitHub] [incubator-nuttx] hartmannathan commented on pull request #4900: Add Board IOCTL for DMA buffer allocation

hartmannathan commented on pull request #4900:
URL: https://github.com/apache/incubator-nuttx/pull/4900#issuecomment-981103849


   This seems more like an architecture issue than a board issue. It will affect all boards using STM32F7, H7, F4. Also problems related to memory regions and DMA will keep coming back again and again unless there is a universal solution. See for example PR #3198: https://github.com/apache/incubator-nuttx/pull/3198 where I ran into issues because SPI6 can only DMA to/from RAM4.
   
   I think memory allocation restrictions only apply to DMA, regardless of architecture. Some architectures can DMA all DMA-aware peripherals to all their memory (e.g., TM4C12x), others can't.
   
   So I think what we need is a special OS-level memory allocator specifically for allocating DMA buffers. It would take some kind of flags indicating which peripheral(s) and direction(s) (memory-to-peripheral, peripheral-to-memory, both), and in turn it would call an arch-specific allocator that knows all the constraints for that arch and therefore can allocate memory in the correct region and alignment.
   
   Then this can be hooked up to a boardctl or ioctl, allowing applications to allocate memory that fits the constraints.
   
   Thoughts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org