# AXI DMA with FFT and PYNQ-Z2

**URL:** <https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850>\
**Category:** Support\
**Created:** [January 14, 2020, 7:34am UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850 "2020-01-14T07:34:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![airic0815](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/airic0815/32/511_2.png) [@airic0815](https://discuss.pynq.io/u/airic0815)\
**Post date:** [January 14, 2020, 7:34am UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/1 "2020-01-14T07:34:19Z")

</div>

I am using the PYNQ-Z2 Board and made a simple Design with Vivado. Also I am debuging my design with ILA Cores via the Micro USB Connection. I just want to peform a simple FFT with a width of 8 samples.

This is the jupyter python code for transferring and receiving the data:

xlnk = Xlnk()  
in\_buffer = allocate(shape=(512,), dtype=np.int32) #shape=(n,)  
out\_buffer = allocate(shape=(512,), dtype=np.int32) #shape=(n,)

# Copy the samples to the in\_buffer

np.copyto(in\_buffer, arr)

# Trigger the DMA transfer and wait for the result

dma.sendchannel.transfer(in\_buffer)  
dma.recvchannel.transfer(out\_buffer)  
dma.sendchannel.wait()  
dma.recvchannel.wait()

The programm stops at at dma.recvchannel.wait(). Stopping the programm results in the following error:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/a204bd40d98efb3c057fe7afa5b8fe9907fd7dfa.png)

When I comment the dma.recvchannel.wait() command debugging shows that there ist data coming out the FFT IP but the S2MM DMA Inteface is inactive:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/3e452293cff0711eb7c1c7cb384e8487ed2988d1.png)

Does anybody know what I am doing wrong?  
[Design.pdf](https://discuss.pynq.io/uploads/short-url/sljrZN9YwkopshO6ds8748ojKUk.pdf) (91.2 KB)

---

<div class="post-metadata">

**Author:** ![r\_n](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@r\_n](https://discuss.pynq.io/u/r_n)\
**Post date:** [January 14, 2020, 6:01pm UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/2 "2020-01-14T18:01:28Z")

</div>

Hi,

Have you tried using an AXI-Stream Data FIFO on the read and write channels of the DMA? I made a simply passthrough example with Zynq → DMA(read) → FIFO → DMA(write) → Zynq and was able to stream data continously. In my experience, the FIFO is necessary to prevent the DMA from stalling.

I tried to recreate your project, but wasn’t sure how you removed the S\_AXIS\_CONFIG port from the FFT IP. How did you do that?

rn

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [January 14, 2020, 6:13pm UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/3 "2020-01-14T18:13:30Z")

</div>

I was having the same confusion too. Your FFT IP has a config port which you have not connected - I am not sure what you are doing with that port.

Also, for your block design, the interconnect `ARESETN` pin should be connected to the `interconnect_aresetn` of the reset block.

 ![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/1X/cc902ef012bc9d4409574b3aee4ed403bcc59aa4.png)  
But don’t get me wrong - this connection error is not the main reason why you got the hanging problem.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [January 15, 2020, 9:52am UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/4 "2020-01-15T09:52:11Z")

</div>

It looks like the TREADY signal has dropped off your FFT block which looks odd. If this is really the case, this might be why you see problems.  
If you think this is the problem, you could try regenerating the design, or removing, and adding the FFT block again.

Cathal

---

<div class="post-metadata">

**Author:** ![airic0815](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/airic0815/32/511_2.png) [@airic0815](https://discuss.pynq.io/u/airic0815)\
**Post date:** [January 15, 2020, 11:20am UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/5 "2020-01-15T11:20:56Z")

</div>

Thank you very much. The problem seems to be that I configured the FFT IP as “Real Time”. If you do so the block doesn’t have a TREADY at the MAXIS\_DATA port. Now I configured the block as “Non Real Time” and it works also withe the dma.recvchannel.wait() command.

Also I gave some constants for the S\_AXIS\_CONFIG port of the FFT block.

Again thank you very much!

[FFT.pdf](https://discuss.pynq.io/uploads/short-url/dw2BFzn4mhO2HCWL5PHnRfwblYa.pdf) (81.1 KB)

---

<div class="post-metadata">

**Author:** ![mattiasu96](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@mattiasu96](https://discuss.pynq.io/u/mattiasu96)\
**Post date:** [March 25, 2021, 2:07pm UTC](https://discuss.pynq.io/t/axi-dma-with-fft-and-pynq-z2/850/6 "2021-03-25T14:07:23Z")

</div>

Can i ask you which values did you put inside the constant for the S\_AXIS\_CONFIG of the fft block? I am configuring my module following the documentation, but i can’t understand what does it expect in those 7 bits of t\_data
