Usage of DMA in IMX7 on cortex m4

Hello,

We are using imx7 in a project. I am developing the Cortex m4 software. I want to use DMA with UART, I2S and SPI peripheral’s in the project. Is there a document or example that explains how to use DMA on the Cortex m4 side? I searched on the forum page but couldn’t find it.

Thanks in advance for your answers

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

Thank you for reaching out with your question. Implementing DMA with peripherals such as UART, I2S, and SPI on the Cortex-M4 of the iMX7 is indeed possible and can enhance the efficiency of your project.

To get started, here are some general steps you can follow:

  1. Understand the Peripheral and DMA Controller: Begin by reviewing the iMX7 reference manual. This document is crucial as it provides detailed information about the DMA controller and the specific peripherals you plan to use.

  2. Configure the Resource Domain Controller (RDC): Ensure that the DMA controller and the peripherals are correctly assigned to the Cortex-M4 domain. This involves setting up the RDC to allow the Cortex-M4 to access these resources.

  3. Set Up Your Development Environment: Depending on whether you are using FreeRTOS or a bare-metal approach, set up your development environment accordingly. Toradex provides FreeRTOS examples that can be adapted for DMA usage.

  4. Initialize DMA and Peripheral Drivers: Develop or modify existing drivers to initialize the DMA controller and configure it for your peripherals. This includes setting up DMA channels, transfer sizes, and handling interrupts.

  5. Develop and Test Your Application: Implement your application logic, ensuring that DMA transfers are correctly initiated and completed. Rigorous testing is essential to ensure data integrity and performance.

While specific examples or documentation might not be readily available, the iMX7 reference manual and other technical resources from NXP can provide valuable guidance on DMA configuration and usage.

If you have any more questions or need further assistance, feel free to ask!

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/i-MX-Processors/DMA-Support-in-FreeRTOS-package-for-imx-7s/td-p/613690.

Hi @Eray,

There is no driver for the DMA on the (iMX7’s) Cortex M, and so there are no examples on how to use it. Also, to use the DMA on the Cortex M you’d have to disable it on the Cortex A, as it is shared between the two.

In this thread you may find more information about the DMA. Quoting erickrieg:

[…]. The SDMA essentially has its own microprocessor that can be programmed in assembly language. I could not find a compiler for it - but read of someone writing their own. The manual for the sdma is over 200 pages long - I could not find any white paper on how to really use it. I concluded it is just too complicated and no simple examples of how to use […]

Best Regards,
Yago