cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wincle
Adventurer
Adventurer
334 Views
Registered: ‎01-24-2014

ZCU106 DMA Linux application - always meet "engine is busy"

Jump to solution

Hi,

I am recently migrating from Zynq7000 to ZCU106 with design using DMA engine. 

I am trying a simple design with DMA engine on PL in attached script. The setup is as follow:

Block Design DiagramBlock Design Diagram

Memory Address SetupMemory Address Setup

PS-PL Interface SetupPS-PL Interface SetupDMA SetupDMA Setup

I am following the DMA simple poll example, and it works under bare metal mode. 

dmabaremetalsimplepoll20202.png

However, when I moved to Linux application using virtual memory address with 'mmap' instead of physical OCM memory address, it always claims 'Engine is busy'. 

Engine is busyEngine is busy

I notice many people use kernel module based on the driver to do the work in kernel space. Does anyone has experience of userspace DMA Linux application on ZCU106 ? Or can AXI DMA used by Linux application in userspace ? 

 

Many thanks. 

0 Kudos
1 Solution

Accepted Solutions
wincle
Adventurer
Adventurer
158 Views
Registered: ‎01-24-2014

For some unknown reason, it is solved by going back to Vivado 2019.1 from Vitis 2020.2.

I put the code on github for the reference:

https://github.com/wincle626/ZCU106_DMA_REF_DESIGN

View solution in original post

0 Kudos
4 Replies
watari
Teacher
Teacher
322 Views
Registered: ‎06-16-2013

Hi @wincle 

 

I have a question before reply.

What is pl_clk0 of clock frequency on Zynq MPSoC IP ?

I guess it seems 20MHz and if so, it's the route cause and I suggest you to change it to ex. 100MHz and so on.

Would you make sure and consider it ?

 

Best regards,

0 Kudos
wincle
Adventurer
Adventurer
267 Views
Registered: ‎01-24-2014

Hi @watari  

I just checked the output clock. As far as I can see from PS IP setup, the frequency is set to 250MHz for the fabric. I think it should not be frequency issue as the bare metal DMA simple poll test works. 

PLclock.png

 

To make sure it is not cause by the frequency setting, I changed it back to 100MHz. 

newPLclock.png

The bare metal DMA simple poll is still working:

dmabaremetalsimplepoll20202_ocm_100mhz.png

But the Linux application DMA simple poll does not work as the same . 

xaxidmalinuxsimplepoll20202_100mhz.png

My understanding is the DMA might be busy moving data to the destination address which is not reachable for some reason. 

 

0 Kudos
wincle
Adventurer
Adventurer
198 Views
Registered: ‎01-24-2014

I just write a simple additive function to check the registers of AXI DMA source address and sending data length.

I found event the address is written by "XAxiDma_WriteReg(InstancePtr->TxBdRing.ChanBase, XAXIDMA_SRCADDR_OFFSET, LOWER_32_BITS(BuffAddr));", when reading it there is not address value but 0x0. 

dmacheck.png

I guess this the reason why DMA is always busy but not sure how this happens. To my understanding, typically, the DMA physical address can be mapped into virtual address through /dev/mem and access under userspace.

Is there any document point out in which condition the DMA can be accessed through virtual memory mapping ? 

0 Kudos
wincle
Adventurer
Adventurer
159 Views
Registered: ‎01-24-2014

For some unknown reason, it is solved by going back to Vivado 2019.1 from Vitis 2020.2.

I put the code on github for the reference:

https://github.com/wincle626/ZCU106_DMA_REF_DESIGN

View solution in original post

0 Kudos