SDR-B1使用Petalinux 2018.3的关键点

我司客户在SDR-B1软件无线电平台上使用Vivado/Petalinux 2018.3时遇到了问题,本文给出相应的解决办法,供所有客户参考。

首先需要注意的是,Petalinux 2018.3中指定设备树的方法与Petalinux 2019.1有所不同,Petalinux 2018.3需要在meta-adi/ meta-adi-xilinx/recipes-bsp/device-tree/device-tree.bbappend中将KERNEL_DTB设定为zynq-adrv9361-z7035-bob。

然后使用Vivado/Petalinux 2018.3,按照《SDR-B1软件无线电平台开发环境搭建》一文给出的方法进行编译,但是得到的固件无法完成启动,会停留在如下位置,随后串口不再有任何反应。

hidraw: raw HID events driver (C) Jiri Kosina

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

尝试在uboot下使用如下命令修改bootargs并启动Linux

setenv bootargs 'console=ttyPS1,115200 earlyprintk ignore_loglevel loglevel=8 initcall_debug'

可以得知Linux卡在初始化SMC也就是静态存储器这里,随后在设备树中禁用nand0与smcc,即修改project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi,增加如下内容

&smcc {
status = "disabled";
};

&nand0 {
status = "disabled";
};

重新编译后系统可正常运行,但是无法通过串口登录到系统中。修改meta-adi/ meta-adi-xilinx/recipes-core/images/petalinux-user-image.bbappend,增加如下内容:

ROOTFS_POSTPROCESS_COMMAND += "add_ttyps1_getty; "

add_ttyps1_getty() {
if [ -f ${IMAGE_ROOTFS}/etc/inittab ]; then
grep -q '^PS1:12345:respawn:/sbin/getty -L ttyPS1 115200 vt100$' ${IMAGE_ROOTFS}/etc/inittab || \
echo 'PS1:12345:respawn:/sbin/getty -L ttyPS1 115200 vt100' >> ${IMAGE_ROOTFS}/etc/inittab
fi
}

再次编译,系统可以正常启动且可以正常登录,然后使用Matlab对AD9361进行测试,一切正常。总结关键点如下:

  1. 在meta-adi/meta-adi-xilinx/recipes-bsp/device-tree/device-tree.bbappend指定设备树
  2. 在project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi中禁用nand0与smcc
  3. 在meta-adi/meta-adi-xilinx/recipes-core/images/petalinux-user-image.bbappend中启用串口登录