芯路恒电子技术论坛

 找回密码
 立即注册
热搜: 合集
查看: 5154|回复: 0

【ZYNQ开发板】文档Linux指令补充

[复制链接]
  • TA的每日心情
    开心
    2022-5-11 16:38
  • 24

    主题

    25

    帖子

    163

    积分

    初级会员

    Rank: 3Rank: 3

    积分
    163
    发表于 2022-4-19 18:50:47 | 显示全部楼层 |阅读模式
    在进行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 = <&ethernet_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
    








    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|小黑屋|Archiver|芯路恒电子技术论坛 |鄂ICP备2021003648号

    GMT+8, 2024-11-1 08:30 , Processed in 0.104550 second(s), 30 queries .

    Powered by Discuz! X3.4

    © 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

    快速回复 返回顶部 返回列表