1、错误现象:
在用Vitis编译工程文件的时候,提示application工程失败,BRAM空间不够了,生成xx.elf失败…
错误提示:
‘Invoking: MicroBlaze gcc linker’
mb-gcc -Wl,-T -Wl,…/src/lscript.ld -LE:/fpga_projects/test4/microblaze_test/export/microblaze_test/sw/microblaze_test/standalone_domain/bsplib/lib -mlittle-endian -mcpu=v11.0 -mxl-soft-mul -Wl,–no-relax -Wl,–gc-sections -o “bootloader.elf” ./src/bootloader.o ./src/platform.o ./src/srec.o -Wl,–start-group,-lxil,-lgcc,-lc,–end-group -Wl,–start-group,-lxilisf,-lxil,-lgcc,-lc,–end-group
c:/xilinx/vitis/2020.1/gnu/microblaze/nt/x86_64-oesdk-mingw32/usr/bin/microblaze-xilinx-elf/…/…/libexec/microblaze-xilinx-elf/gcc/microblaze-xilinx-elf/9.2.0/real-ld.exe: bootloader.elf section .stack' will not fit in region
microblaze_0_local_memory_ilmb_bram_if_cntlr_Mem_microblaze_0_local_memory_dlmb_bram_if_cntlr_Mem’
c:/xilinx/vitis/2020.1/gnu/microblaze/nt/x86_64-oesdk-mingw32/usr/bin/microblaze-xilinx-elf/…/…/libexec/microblaze-xilinx-elf/gcc/microblaze-xilinx-elf/9.2.0/real-ld.exe: region `microblaze_0_local_memory_ilmb_bram_if_cntlr_Mem_microblaze_0_local_memory_dlmb_bram_if_cntlr_Mem’ overflowed by 744 bytes
collect2.exe: error: ld returned 1 exit status
‘Finished building target: bootloader.elf’
2、查看BRAM空间大小:
选择自己的application工程,然后右键,选择【Generate Linker Script】,点击进去;查看Vivado设置的BRAM空间大小;
这时,需要回到Vivado工程里面,在Block Design中将分配的BRAM空间大小改大。具体方法如下。
3、修改BRAM空间大小:
(1):进入IP INTEGRATOR的Address Edditor:
(2):修改BRAM空间大小,由16KB改为32KB(可以根据实际情况来修改空间大小),保存,然后重新生成bit文件。
(3):生成完bit文件后,重新导出xsa文件:
4、回到Vitis里面,重新导入xsa文件:
5、查看新导入的xsa文件里面的BRAM空间大小:
6、重新编译application工程,查看结果。