在进行ZYNQ的Linux部分开发过程中,由于在教程PDF中复制长指令会在指令后加换行导致指令无法正确执行,在本贴中贴出其中容易出错的指令供读者使用。
**4.2.3 修改设备树文件**
删除创建的文件中的内容,添加以下内容。添加完成之后点击保存并退出。
[C#] 纯文本查看 复制代码 /*
* CAUTION: This file is automatically generated by Xilinx.
* Version:
* Today is: Fri Sep 10 16:14:05 2021
*/
/dts-v1/;
#include "zynq-7000.dtsi"
#include "pcw.dtsi"
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/input/linux-event-codes.h>
#define GPIO_ACTIVE_HIGH 0
#define GPIO_ACTIVE_LOW 1
/ {
model = "ACZ702 ZYNQ Development Board";
chosen {
bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait";
stdout-path = "serial0:115200n8";
};
aliases {
ethernet0 = &gem0;
serial0 = &uart1;
spi0 = &qspi;
};
memory {
device_type = "memory";
reg = <0x0 0x20000000>;
};
leds {
compatible = "gpio-leds";
led0 {
label = "ps_led";
gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
default-state = "on";
};
};
keys {
compatible = "gpio-keys";
autorepeat;
key0 {
label = "ps_key";
linux,code = <KEY_1>;
gpios = <&gpio0 47 GPIO_ACTIVE_LOW>;
debounce-interval = <15>;
};
};
};
&gem0 {
phy-handle = <ðernet_phy>;
local-mac-address = [00 0a 35 00 1e 53];
ethernet_phy: ethernet-phy@1 {
reg = <0x1>;
device_type = "ethernet-phy";
};
};
&qspi {
#address-cells = <1>;
#size-cells = <0>;
flash0: flash@0 {
compatible = "n25q128a","micron,m25p80";
reg = <0x0>;
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <50000000>;
partition@0x00000000 {
label = "boot";
reg = <0x00000000 0x00500000>;
};
partition@0x00500000 {
label = "bootenv";
reg = <0x00500000 0x00020000>;
};
partition@0x00520000 {
label = "kernel";
reg = <0x00520000 0x00a80000>;
};
partition@0x00fa0000 {
label = "spare";
reg = <0x00fa0000 0x00000000>;
};
};
};
**4.2.10设置开发板启动模式**
在 uboot 下配置环境变量。复制下面的内容到 uboot 下。首次进入 uboot 需要进行环境变量设置,输入以下设置指令。[C#] 纯文本查看 复制代码 setenv kernel_image zImage
setenv devicetree_image system.dtb
setenv sdboot 'if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && fatload mmc 0 ${kernel_load_address} ${kernel_image} && fatload mmc 0 ${devicetree_load_address} ${devicetree_image} && bootz ${kernel_load_address} - ${devicetree_load_address}; fi'
saveenv
run sdboot
**10.1.4搭建PWM系统工程**
由于PWM系统工程带有PL端,因此需要在uboot下配置下载比特流文件,否则系统无法正常运行。因此这里需要在uboot倒计时的时候,按下任意按键打断计数,然后复制下面的指令内容到 uboot 下,再按下回车键,即可启动linux系统。[C#] 纯文本查看 复制代码 setenv bitstream_load_address 0x100000
setenv bitstream_image system.bit
setenv bitstream_size 0x300000
setenv kernel_image zImage
setenv devicetree_image system.dtb
setenv sdboot 'if mmcinfo; then run uenvboot; echo Copying Linux from SD to RAM... && fatload mmc 0 ${bitstream_load_address} ${bitstream_image} && fpga loadb 0 ${bitstream_load_address} ${bitstream_size} && fatload mmc 0 ${kernel_load_address} ${kernel_image} && fatload mmc 0 ${devicetree_load_address} ${devicetree_image} && bootz ${kernel_load_address} - ${devicetree_load_address}; fi'
saveenv
run sdboot
|