Using DMA from M7 target on IMX8M+

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using DMA from M7 target on IMX8M+

717 Views
David_Sailor
Contributor I

Hi,

I'm using IMX8M+ SOC with:

  • LINUX kernel on A53 using UART1 with SDMA1
  • FreeRTOS on M7 using UART2 bus

I want to use a DMA on UART2, but the refManual says: 

• SDMA-1 is a general-purpose DMA engine which can be used by low speed

peripherals including UART, SPI and also others peripherals.

• SDMA-2 and SMDA-3 is used for audio interface, including SAI-1/2/3/5/6/7, SPDIF and PDM audio input.

My questions are:

  • If SDMA1 is already used by LINUX four UART1, can I use SDMA1 on M7 side for UART2 ?
  • SDMA2/3 are dedicated to another functions, can I use them if I don't use SAI or audio?
  • I've seen that eDMA is available, but I don't see it on memory map, only SDMA are mapped (chap 2.4). Is it possible to use it for UART?

Thanks for your help

0 Kudos
Reply
3 Replies

662 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

I can address your question about using DMA with UART2.

The i.MX8M Plus has multiple SDMA controllers with specific purposes:
- SDMA-1 is the general-purpose DMA engine designed for low-speed peripherals including UART
- SDMA-2 and SDMA-3 are dedicated to audio interfaces (SAI, SPDIF, PDM)

For UART2 implementation with DMA, you should use SDMA-1. This controller is specifically intended to handle DMA operations for UART interfaces along with other low-speed peripherals like SPI.

When implementing this on the M7 core, be aware of potential resource conflicts if Linux is running on the A53 cores simultaneously. In such cases, you may need to disable SDMA1 in the Linux device tree to prevent conflicts between cores attempting to access the same DMA controller.

The UART driver in combination with SDMA1 is the appropriate configuration for your UART2 DMA implementation on the i.MX8M Plus.

Regards

0 Kudos
Reply

604 Views
David_Sailor
Contributor I

Hi,

thanks for your answer.

Linux uses UART1 with SDMA1, so if I understand your answer, I can't use SDMA1 for UART2 on M7 side.

Can I use eDMA to retrieve data from UART2 ?

Regards

0 Kudos
Reply

596 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

Yes, you can use eDMA to retrieve data from a UART, including UART2, on an i.MX processor by configuring the eDMA controller to trigger on a UART receive request and directing the data to a memory buffer.

regards

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2207449%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EUsing%20DMA%20from%20M7%20target%20on%20IMX8M%2B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2207449%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EI'm%20using%20IMX8M%2B%20SOC%20with%3A%3C%2FP%3E%3CUL%3E%3CLI%3ELINUX%20kernel%20on%20A53%20using%20UART1%20with%20SDMA1%3C%2FLI%3E%3CLI%3EFreeRTOS%20on%20M7%20using%20UART2%20bus%3C%2FLI%3E%3C%2FUL%3E%3CP%3EI%20want%20to%20use%20a%20DMA%20on%20UART2%2C%20but%20the%20refManual%20says%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%E2%80%A2%20SDMA-1%20is%20a%20general-purpose%20DMA%20engine%20which%20can%20be%20used%20by%20low%20speed%3C%2FP%3E%3CP%3Eperipherals%20including%20UART%2C%20SPI%20and%20also%20others%20peripherals.%3C%2FP%3E%3CP%3E%E2%80%A2%20SDMA-2%20and%20SMDA-3%20is%20used%20for%20audio%20interface%2C%20including%20SAI-1%2F2%2F3%2F5%2F6%2F7%2C%20SPDIF%20and%20PDM%20audio%20input.%3C%2FP%3E%3CP%3EMy%20questions%20are%3A%3C%2FP%3E%3CUL%3E%3CLI%3EIf%20SDMA1%20is%20already%20used%20by%20LINUX%20four%20UART1%2C%20can%20I%20use%20SDMA1%20on%20M7%20side%20for%20UART2%20%3F%3C%2FLI%3E%3CLI%3ESDMA2%2F3%20are%20dedicated%20to%20another%20functions%2C%20can%20I%20use%20them%20if%20I%20don't%20use%20SAI%20or%20audio%3F%3C%2FLI%3E%3CLI%3EI've%20seen%20that%20eDMA%20is%20available%2C%20but%20I%20don't%20see%20it%20on%20memory%20map%2C%20only%20SDMA%20are%20mapped%20(chap%202.4).%20Is%20it%20possible%20to%20use%20it%20for%20UART%3F%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThanks%20for%20your%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2221857%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20DMA%20from%20M7%20target%20on%20IMX8M%2B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2221857%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI%20can%20address%20your%20question%20about%20using%20DMA%20with%20UART2.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20i.MX8M%20Plus%20has%20multiple%20SDMA%20controllers%20with%20specific%20purposes%3A%3CBR%20%2F%3E-%20SDMA-1%20is%20the%20general-purpose%20DMA%20engine%20designed%20for%20low-speed%20peripherals%20including%20UART%3CBR%20%2F%3E-%20SDMA-2%20and%20SDMA-3%20are%20dedicated%20to%20audio%20interfaces%20(SAI%2C%20SPDIF%2C%20PDM)%3CBR%20%2F%3E%3CBR%20%2F%3EFor%20UART2%20implementation%20with%20DMA%2C%20you%20should%20use%20SDMA-1.%20This%20controller%20is%20specifically%20intended%20to%20handle%20DMA%20operations%20for%20UART%20interfaces%20along%20with%20other%20low-speed%20peripherals%20like%20SPI.%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20implementing%20this%20on%20the%20M7%20core%2C%20be%20aware%20of%20potential%20resource%20conflicts%20if%20Linux%20is%20running%20on%20the%20A53%20cores%20simultaneously.%20In%20such%20cases%2C%20you%20may%20need%20to%20disable%20SDMA1%20in%20the%20Linux%20device%20tree%20to%20prevent%20conflicts%20between%20cores%20attempting%20to%20access%20the%20same%20DMA%20controller.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20UART%20driver%20in%20combination%20with%20SDMA1%20is%20the%20appropriate%20configuration%20for%20your%20UART2%20DMA%20implementation%20on%20the%20i.MX8M%20Plus.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERegards%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248169%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20DMA%20from%20M7%20target%20on%20IMX8M%2B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248169%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3Ethanks%20for%20your%20answer.%3C%2FP%3E%3CP%3ELinux%20uses%20UART1%20with%20SDMA1%2C%20so%20if%20I%20understand%20your%20answer%2C%20I%20can't%20use%20SDMA1%20for%20UART2%20on%20M7%20side.%3C%2FP%3E%3CP%3ECan%20I%20use%20eDMA%20to%20retrieve%20data%20from%20UART2%20%3F%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2248441%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Using%20DMA%20from%20M7%20target%20on%20IMX8M%2B%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248441%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%0A%3CP%3EYes%2C%20you%20can%20use%20eDMA%20to%20retrieve%20data%20from%20a%20UART%2C%20including%20UART2%2C%20on%20an%20i.MX%20processor%20by%20configuring%20the%20eDMA%20controller%20to%20trigger%20on%20a%20UART%20receive%20request%20and%20directing%20the%20data%20to%20a%20memory%20buffer.%3C%2FP%3E%0A%3CP%3Eregards%3C%2FP%3E%3C%2FLINGO-BODY%3E