Petalinux添加UARTLite无法找到设备的相关问题解决办法

项目场景:

平台:ZCU104(赛灵思ZynqMP官方开发板)
软件:Vivado 2020.2 + Petalinux 2020.2
描述:使用官方IP UARTLite 作为PL端拓展串口

问题描述:

1.导出Vivadao硬件的时候,没有 lunch SDK 选项,无法打开SDK来导出.hdf硬件描述文件。

2.导入到petalinux并编译后,在系统中找不到串口设备信息(ttyUL*),并在反编译生成的设备树中也没有找到相关设备树信息。

原因分析:

1.Xilinx官方已经声明,在 Vivado2019.2 后续版本将不再带有SDK功能,其相关功能将被一同整合进Vitis。原先的.hdf硬件描述文件将被.xsa代替,并可以直接在Vivado中导出(如图)。
导出硬件描述文件
2.虽然我并不怎么会设备树语法,但是我觉得问题比较可能出现在这里。在根据官方参考手册(UG1144 pg193)的工程结构找到了工程设备树文件存放目录。并在文件工程根目录/components/plnx_workspace/device-tree/devicetree/pl.dtsi下找到了相关的设备树描述

/ {
	amba_pl: amba_pl@0 {
		#address-cells = <2>;
		#size-cells = <2>;
		compatible = "simple-bus";
		ranges ;
		axi_uartlite_0: serial@a0000000 {
			clock-names = "s_axi_aclk";
			clocks = <&zynqmp_clk 71>;
			compatible = "xlnx,axi-uartlite-2.0", "xlnx,xps-uartlite-1.00.a";
			current-speed = <115200>;
			device_type = "serial";
			port-number = <1>;
			reg = <0x0 0xa0000000 0x0 0x10000>;
            status = "okay";
			xlnx,baudrate = <0x1c200>;
			xlnx,data-bits = <0x8>;
			xlnx,odd-parity = <0x0>;
			xlnx,s-axi-aclk-freq-hz-d = "100.0";
			xlnx,use-parity = <0x0>;
		};
	};
};

根据描述理论上该设备应该是存在。根据帖子Petalinux 2019.1: No device file for PL UARTLite的描述,有可能缺少status = "okay";描述,在尝试添加后依然检测不到设备。

尝试复制相同内容到.../project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi后依然找不到设备。

最后根据帖子zcu104 no PL UART /dev/ttyUL后面vanmierlo的回复

The interrupt is not connected as can be derived from a missing interrupt entry in the generated device tree. But the linux driver will not work without interrupt. There is no place for polling in a Linux kernel driver.
中断没有连接,可以从生成的设备树中缺少中断条目得出。但是没有中断,linux驱动就无法工作。在Linux内核驱动中没有轮询的地方。

察觉到自己应该是没有连接中断信号,导致实际编译出现问题。
缺少中断信号线


解决方案:

重新连接中断信号线后(如图),再次导出硬件描述文件到Petalinux,可以看到设备树中已经添加有对中断的描述。
添加中断信号线

/ {
	amba_pl: amba_pl@0 {
		#address-cells = <2>;
		#size-cells = <2>;
		compatible = "simple-bus";
		ranges ;
		axi_uartlite_0: serial@a0000000 {
			clock-names = "s_axi_aclk";
			clocks = <&zynqmp_clk 71>;
			compatible = "xlnx,axi-uartlite-2.0", "xlnx,xps-uartlite-1.00.a";
			current-speed = <115200>;
			device_type = "serial";
			interrupt-names = "interrupt";
			interrupt-parent = <&gic>;
			interrupts = <0 89 1>;
			port-number = <1>;
			reg = <0x0 0xa0000000 0x0 0x10000>;
			xlnx,baudrate = <0x1c200>;
			xlnx,data-bits = <0x8>;
			xlnx,odd-parity = <0x0>;
			xlnx,s-axi-aclk-freq-hz-d = "100.0";
			xlnx,use-parity = <0x0>;
		};
	};
};

查看Petalinux的设备目录后可以发现已经有了串口设备,其中ttyPS*是两个PS端串口,ttyUL1是PL端串口。
串口设备

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值