导出bit文件,修改uEnv.txt文件,修改bitstream_image为自己的bit文件,如system_top.bit,并增加两行:
bitstream_image=system_top.bit
mmc_loadbit_fat=echo Loading bitstream ${bitstream_image} from SD to RAM... && mmcinfo && fatload mmc 0 ${loadbit_addr} ${bitstream_image} && fpga loadb 0 ${loadbit_addr} ${filesize}
uenvcmd=run mmc_loadbit_fat
其中uenvcmd会自动运行,从而加载bit文件。
然后将system_top.bit放到sd卡根目录下,重启。
可以看到如下输出:
Running uenvcmd ...
Loading bitstream system_top.bit from SD to RAM...
Device: sdhci@e0100000
Manufacturer ID: 89
OEM: 303
Name: NCard
Tran Speed: 50000000
Rd Block Len: 512
SD version 3.0
High Capacity: Yes
Capacity: 29.1 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading system_top.bit
4045666 bytes read in 369 ms (10.5 MiB/s)
design filename = "system_top;UserID=0XFFFFFFFF;Version=2021.1"
part number = "7z020clg400"
date = "2023/08/21"
time = "23:59:02"
bytes in bitstream = 4045564
zynq_align_dma_buffer: Align buffer at 100066 to 100000(swap 1)
注意,这里是uboot重新加载了一次bit文件,fsbl先前已经加载了bit文件,只是这里被覆盖了。如果不想fsbl加载bit文件,需要修改boot.bin的生成。
vivado2019.1+;
uboot16+;