petalinux 修改设备树

一、设备树生成及编译

  1、执行petalinux-create创建工程

  2、执行petalinux-config --get-hw-description导入硬件配置

  3、执行petalinux-config -c device-dree生成设备树,生成的设备树在petalinux_project\components\plnx_workspace\device-tree\ 目录下

  4、执行petalinux-build -c device-dree 编译设备树,编译后的dtb文件为petalinux_project\test_msxbo_mzu04a\test_linux_driver\pre-built\linux\images\system.dtb。(如果是执行petalinux-build则一步到位编译设备树、内核、uboot等) 

    注:如果不是第一次编译设备树,即使修改了设备树执行petalinux-build -c device-dree也不会生成dtb文件,这时应先执行petalinux-build -c device-tree -x cleansstate 清理编译状态后再编译设备树。

二、修改设备树

  petalinux_project\components\plnx_workspace\device-tree\ 目录下的设备树是软件自动生成的,最好不做修改,xilinux提供了一个用户设备树,该设备树为:petalinux_project\test_msxbo_mzu04a\test_linux_driver\project-spec\meta-user\recipes-bsp\device-tree\files\system-user.dtsi。petalinux_project\components\plnx_workspace\device-tree\ system-top.dts最终是包含了system-user.dtsi,如下图所示:

petalinux 修改设备树

 

三、设备树反编译

  dtb文件可用dtc编译工具反编译成dts,linux提供的dtc源码在petalinux_project\test_msxbo_mzu04a\test_linux_driver\build\tmp\work-shared\zynqmp-generic\

kernel-source\scripts\dtc目录下。执行petalinux-build后,会将dtc源码编译成dtc应用程序petalinux_project\test_msxbo_mzu04a\test_linux_driver\build\tmp\sysroots-components\x86_64\dtc-native\usr\bin\dtc,

可以把system.dtb复制到该目录下,执行/dtc -I dtb -O dts -o system.dts system.dtb 会生成system.dts。

petalinux 修改设备树

上一篇:Netsharp快速入门(之9) 基础档案(工作区3 添加商品菜单,以及在产品中打开商品界面)


下一篇:linux 查大文件及目录