# Need help to use cdma in PYNQ Z2

**URL:** <https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374>\
**Category:** Support\
**Created:** [December 2, 2021, 4:05pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374 "2021-12-02T16:05:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![louishin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/louishin/32/2622_2.png) [@louishin](https://discuss.pynq.io/u/louishin)\
**Post date:** [December 2, 2021, 4:05pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374/1 "2021-12-02T16:05:47Z")

</div>

Hi, I’m newbie for using PYNQ-Z2.  
I heard that moving data from dram in ps area to bram in PL area, using cdma module can transfer more fast.

I’m not familiar with this so I found the below documents and follow the tutorial. but I can’t write any code with jupyter notebook.

> <https://github.com/xupgit/Advanced-Embedded-System-Design-Flow-on-Zynq/blob/master/lab4.md>

Could someone please give me advice? thanks.

---

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [December 2, 2021, 5:49pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374/2 "2021-12-02T17:49:37Z")

</div>

Hi @louishin,

The `allocate()` API in pynq allocates memory physically contiguous in memory and then you can use the DMA to move the data.

[https://pynq.readthedocs.io/en/latest/pynq\_package/pynq.buffer.html#pynq.buffer.allocate](https://pynq.readthedocs.io/en/latest/pynq_package/pynq.buffer.html#pynq.buffer.allocate)

There’s a great tutorial about DMA here: [Tutorial: PYNQ DMA (Part 1: Hardware design)](https://discuss.pynq.io/t/tutorial-pynq-dma-part-1-hardware-design/3133)

Mario

---

<div class="post-metadata">

**Author:** ![louishin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/louishin/32/2622_2.png) [@louishin](https://discuss.pynq.io/u/louishin)\
**Post date:** [December 2, 2021, 6:08pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374/3 "2021-12-02T18:08:56Z")

</div>

Thanks for your kind reply, mario.

I’ve already done that tutorial about using DMA. But I think DMA module do not support the data transfer from DDR to block memory in PL. So that I want to operate the AXI CDMA. It supports memory map to memory map transfers.  
Do I misunderstand the usage of DMA?

---

<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:** [December 2, 2021, 6:13pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374/4 "2021-12-02T18:13:30Z")

</div>

What do you want to do with the data once it is in BRAM (block memory in PL)? How will your IP consume the data?

Cathal

---

<div class="post-metadata">

**Author:** ![louishin](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/louishin/32/2622_2.png) [@louishin](https://discuss.pynq.io/u/louishin)\
**Post date:** [December 2, 2021, 6:40pm UTC](https://discuss.pynq.io/t/need-help-to-use-cdma-in-pynq-z2/3374/5 "2021-12-02T18:40:09Z")

</div>

Umm… there’s no plan about consuming data on bram. I heard that by using cmda, more fast data transfer could be possible (PS DDR \<-\> PL BRAM) compared to the mimo write.  
I just want to check but it’s really important to me. Thanks, Cathal.
