【教程】Agilex 5 SoC 的两种启动模式的开发演示(二)(HPS Boot First )
六、DE25-Nano 开发板 HPS Boot First 模式演示准备 FPGA配置文件下载并打开DE25-Nano_revB_v.1.0.0_ResourcePackage\Demonstration\SoC_FPGA\GHRD工程中的golden_top.qsf文件添加设置set_global_assignment -name HPS_INITIALIZATION HPS FIRST保存设置并编译GHRD工程设置Quartus的环境变量export QUARTUS_ROOTDIR/home/doreen/altera_pro/25.1.1/quartus export PATH$QUARTUS_ROOTDIR/bin:$PATH在output_files目录执行下面的指令生成golden_top.hps.jic和golden_top.core.rbfquartus_pfg -c golden_top.sof golden_top.jic -o deviceMT25QU128 -o flash_loaderA5EB013BB23B -o hps_path../software/u-boot/spl/u-boot-spl-dtb.hex -o modeASX4 -o hps1如若遇到libboost_atomic-mt-x64.so.1.81.0、libicui18n.so.69库找不到的问题请增加环境变量设置这些文件 在quartus/linux64目录下都是有的export LD_LIBRARY_PATH$QUARTUS_ROOTDIR/linux64:$LD_LIBRARY_PATH在output_files目录执行下面的指令将golden_top.hps.jic 文件烧写到QSPI Flashquartus_pgm -m jtag -c 1 -o pvi;golden_top.hps.jic备注HPS Boot First模式下固化的.jic文件没包含fpga数据而是包含sdm固件、hps emif io 数据、以及spl等等。参考下图准备设备树Overlay文件准备 ghrd.dts 文件如下/dts-v1/;/plugin/;/ {fragment0 {target-path /fpga-region;__overlay__ {firmware-name golden_top.core.rbf;};};};编译dtbo指令如下dtc - -I dts -O dtb -o ghrd.dtbo ghrd.dts准备MicroSD启动卡参考【教程】Linux上用命令烧写SD卡和Windows上用Win32DiskImager工具一键烧写SD卡 de25_nano_revA_sdcard_console_v1.1.img 烧写到SD卡。把烧写好的SD卡插上读卡器再插到Ubuntu PC拷贝golden_top.core.rbf、ghrd.dtbo以及run_overlay.sh文件到SD卡的文件系统盘的/home/terasic路径下run_overlay.sh内容如下#!/bin/bash mkdir /sys/kernel/config/device-tree/overlays/ghrd echo ghrd.dtbo /sys/kernel/config/device-tree/overlays/ghrd/path启动开发板观察测试结果继续参考【教程】Linux上用命令烧写SD卡和Windows上用Win32DiskImager工具一键烧写SD卡启动开发板打开串口终端DE25-Nano开发板 boot进入linux后拷贝golden_top.core.rbf、ghrd.dtbo 到 /lib/firmware然后执行run_overlay.sh脚本。sudo cp golden_top.core.rbf /lib/firmware/ sudo cp ghrd.dtbo /lib/firmware/ sudo ./run_overlay.sh观察现象加载rbf(.dtbo里面有加载rbf的指令)之前FPGA 端LED不亮加载后FPGA端LED亮起且有一个LED闪烁本文部分截图参考Altera文Altera Documentation and Resources Center【教程】Agilex 5 SoC 的两种启动模式的开发演示一FPGA Configuration First参考https://mp.weixin.qq.com/s/qmAmJBihwH8CFhNzNBxGJg