该项目用2018.2版Vivado, SDSoC, Petalinux搭建,只适用于2018.2版本!
搭建环境:
Windows10: Vivado2018.2, SDSoC2018.2(也可以在Ubuntu16.04完成)
Ubuntu16.04: Petalinux2018.2
PYNQ-Z1/Z2, v2.1 img
$ petalinux-create --type project --template zynq --name PYNQ_DYNCLK
将PYNQ_DYNCLK.dsa复制到PYNQ_DYNCLK/路径下
$ cd PYNQ_DYNCLK/
$ petalinux-config --get-hw-description ./
DTG Settings->Kernel Bootargs->user set kernel bootargs 输入
console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait
Image Packaging Configurations->Root filesystem type->SD card
$ petalinux-config -c kernel
Device Drivers->Generic Driver Options->Size in Mega Bytes(256)
Device Drivers->Staging drivers (ON)->Xilinx APF Accelerator driver (ON)->Xilinx APF DMA engines support (ON)
这一步会在project-spec/meta-user/recipes-kernel/linux/linux-xlnx/路径下生成kernel.cfg文件, 也可以直接将下面这段的复制过去
CONFIG_CMA_SIZE_MBYTES=256
CONFIG_STAGING=y
CONFIG_XILINX_APF=y
CONFIG_XILINX_DMA_APF=y
/{
xlnk {
compatible = "xlnx,xlnk-1.0";
};
};
$ petalinux-build
在/images/linux/下找到zynq_fsbl.elf, u-boot.elf, image.ub这些是之后创建SDSoC Platform要用到的东西
参照UG1236将之前准备好的image.ub, zynq_fsbl, uboot打包成一个SDSoC的Platform, 也可以直接用SDSoC/PYNQ_DYNCLK。
将SDSoC Platform后复制到/Xilinx/SDx/2018.2/platforms路径下
$ git clone https://github.com/jiangwx/DYNCLK.git
$ cd DYNCLK
$ cd drivers
$ gcc DYNCLK.c -o DYNCLK
$ sudo cp DYNCLK /mnt