Booting Zynq UltraScale Via JTAG,Xilinx MPSOC平台使用JTAG加载和运行Uboot的脚本

基本步骤:

• Program the Programmable Logic (PL) bitstream

• Load the PMU firmware (PMUFW) image

• Load the FSBL binary

• Load U-Boot

• Load ARM Trusted Firmware (ATF)

2tcl脚本


targets -set -nocase -filter {name=~"*PL*"}

fpga design.bit
targets -set -filter {name=~"PSU"}
#disable security gates for DAP PLTAP and PMU
mwr 0xFFCA0038 0x1FF
after 500

#load and run pmufw
targets -set -filter {name=~"MicroBlaze PMU"}
dow pmufw.elf
con
after 500

targets -set -filter {name=~"Cortex-A53 #0"}
rst -processor
dow fsbl.elf
con
after 10000
stop

dow u-boot.elf
dow bl31.elf
con
after 5000
stop

#dow u-boot.elf
#con
#rrd pc  display pc address
#rwr pc 0x100000 set pc point to 0x100000
#dow -data BOOT.bin 0x8000
QEMU是一个通用的虚拟化器,可以模拟多种体系结构的计算机,包括ARM。但是,模拟Zynq的PYNQ需要一些额外的步骤和配置。 以下是在Ubuntu上使用QEMU模拟Zynq的PYNQ的步骤: 1. 安装必要的软件 ``` sudo apt-get install qemu-system-arm unzip ``` 2. 下载PYNQ映像文件 从PYNQ官网下载适合Zynq的映像文件,例如`pynq_z1_v2.5.img.zip`。 3. 解压映像文件 ``` unzip pynq_z1_v2.5.img.zip ``` 4. 安装交叉编译工具链 ``` sudo apt-get install gcc-arm-linux-gnueabihf ``` 5. 启动QEMU ``` qemu-system-arm -M xilinx-zynq-a9 -m 1024M -serial stdio -kernel zImage -dtb system.dtb -drive file=pynq_z1_v2.5.img,if=sd,format=raw ``` 解释一下每个参数的含义: - `-M xilinx-zynq-a9`:指定使用Zynq A9作为模拟器中的CPU。 - `-m 1024M`:为模拟器分配1GB的内存。 - `-serial stdio`:将串口输出重定向到终端窗口。 - `-kernel zImage`:指定内核镜像文件。 - `-dtb system.dtb`:指定设备树文件。 - `-drive file=pynq_z1_v2.5.img,if=sd,format=raw`:将PYNQ的映像文件作为SD卡插入模拟器中。 6. 在模拟器中运行PYNQ 启动QEMU后,会出现类似以下内容的输出: ``` U-Boot 2016.07 (Oct 26 2020 - 04:51:25 +0000) DRAM: 1024 MiB MMC: zynq_sdhci: 0 In: serial@e0001000 Out: serial@e0001000 Err: serial@e0001000 Net: ZYNQ GEM: e000b000, phyaddr 7, interface rgmii-id eth0: ethernet@e000b000 Hit any key to stop autoboot: 0 Booting from mmc ... reading image.ub ** Unable to read file image.ub ** ** Unable to read file image.ub ** Booting from net ... BOOTP broadcast 1 ``` 此时,PYNQ还没有完全启动。按下任意键停止自动启动,然后在u-boot提示符下输入以下命令: ``` setenv bootargs console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait fatload mmc 0 0x3000000 uImage bootm 0x3000000 - 0x2A00000 ``` 这些命令将设定启动参数和从SD卡加载内核镜像和根文件系统。然后,PYNQ就会开始启动了。 注意:由于QEMU是模拟器而不是真正的硬件,因此模拟速度可能较慢,而且某些硬件特性可能无法完全模拟。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值