Xilinx PetaLinux 工具链交叉编译xilinx_axidma源码出现“Unable to allocate contiguous DMA memory”的解决办法
调试axidma_dma时出现以下问题:
root@ALIENTEK-ZYNQ:/mnt/sd-mmcblk0p2/usr/src/xilinx_axidma/outputs# ./axidma_benchmark
AXI DMA Benchmark Parameters:
Transmit Buffer Size: 7.91 MiB
Receive Buffer Size: 7.91 MiB
Number of DMA Transfers: 1000 transfers
cma: cma_alloc: alloc failed, req-size: 2025 pages, ret: -12
axidma: axidma_chrdev.c: axidma_mmap: 283: Unable to allocate contiguous DMA memory region of size 8294400.
axidma: axidma_chrdev.c: axidma_mmap: 285: Please make sure that you specified cma=<size> on the kernel command line, and the size is large enough.
Unable to allocate receive buffer from the AXI DMA device: Cannot allocate memory
root@ALIENTEK-ZYNQ:/mnt/sd-mmcblk0p2/usr/src/xilinx_axidma/outputs#
查看内核配置:
已经打开
修改设备树:
增加以下代码,问题的已解决:
chosen {
bootargs = "console=ttyPS0,115200 earlycon root=/dev/ram0 rw cma=25M";
stdout-path = "serial0:115200n8";
};