kriation 2 dma
- maikon12
- Jan 7
- 2 min read
7/1/2025
Kria, DMA, and Petalinux
0) kriate the project and add AXI DMA IP, apply the preset of the Kria board.
The block diagram is below,
![]() |
For this design, I connected the AXI DMA IP straight to the high performance ports.
Also I connected directly the ports S_AXIS_S2MM and M_AXIS_MM2S ( for the future reference, this port will the port you would connect other IP ) .
The only configuration I changed is the Memory Map Data Width to 128 to be compatible to the HP port in the Zynq PS.
![]() |
The Address is 0xA0000000 for the DMA , labeled axi_dma_0 as seem.
1) Kreate the Petalinux Project.
The basic commands for me:
1.1 – create the petalinux project and in my case using the bsp from Xilinx for Kria.
For some reason, in my case, the system did not come with some settings, such as enabling the uart when the kernel take over, which I edited in the petalinux-config:
![]() |
2) Kreate the module for the dma driver, which I am using one from:
2.1 – add the kernel to the driver with the command:
nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-create --type modules --name u-dma-buf –enable
2.2 - copy the file got from github to:
/home/nasa/kria/dma/peta/petadma1/project-spec/meta-user/recipes-modules/u-dma-buf/files
the files copied was the Makefile and u-dma-buf.c
![]() |
2.3 – configure the device tree adding the udmabuf component and linking axi_dma_0:
![]() |
that”s a print of the location and the edit.
2.4 – build the petalinux with petalinux-build
2.5 – you will see the driver in the user-rootfsconfig:
![]() |
3) once it all build up, now package the design to flash to a SD card with the commands
nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-package --boot --fsbl --pmufw --fpga --u-boot --kernel --dtb --force
nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-package --wic --images-dir images/linux/ --bootfiles "ramdisk.cpio.gz.u-boot, boot.scr, Image, system.dtb"
4) checking the design , if all goes well the driver will be there:
udmabuf0 ![]() |
5) the performance test and also a copy of the design can be found at:
I install the c/c++ compiler with:
xilinx-kv260-starterkit-20222:~$ dnf install packagegroup-petalinux-self-hosted
![]() |
Summary:
nasa@nasa:~/kria/dma/peta$ petalinux-create -t project -s /media/nasa/mybook/kria/xilinx-kv260-starterkit-v2022.2-10141622.bsp -n petadma1 |
Cd petadma1 |
Configure petalinux with: nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-config |
Create the module in the petalinux project: nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-create --type modules --name u-dma-buf –enable |
Copy the files from the github u-dma-buf to the project: /home/nasa/kria/dma/peta/petadma1/project-spec/meta-user/recipes-modules/u-dma-buf/files |
Edit system-user.dtsi in project-spec/meta-user/recipes-bsp/device-tree/files /include/ "system-conf.dtsi" / { udmabuf@0x00 { compatible = "ikwzm,u-dma-buf"; device-name = "udmabuf0"; minor-number = <0>; size = <0x4000000>; sync-mode = <1>; sync-always; }; }; &axi_dma_0{ compatible = "generic-uio"; }; |
Build the design with : petalinux-build |
Package the design and flash to a sd card: nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-package --boot --fsbl --pmufw --fpga --u-boot --kernel --dtb --force nasa@nasa:~/kria/dma/peta/petadma1$ petalinux-package --wic --images-dir images/linux/ --bootfiles "ramdisk.cpio.gz.u-boot, boot.scr, Image, system.dtb" |
Test the design with : xilinx-kv260-starterkit-20222:~$ sudo ./timerNdma |
Comments