由于Altera SOS EDS 版本 13.0 和 13.1 出现问题,构建非半托管应用程序所需的组装器代码缺失。
要解决此问题,请按照以下步骤下载所需的组装器文件,然后更新链接器脚本以禁用半托管。
可以从以下链接下载基于 soC EDS 13.0Sp1 的Altera-SoCFPGA-HardwareLib-GNU.tar.gz 示例 Makefile 和 Linker 脚本: ExampleFiles_nonSemiHosted.zip(altera-socfpga.ld、Makefile、reset.s)
使用 Altera 示例作为模板的启用非半托管应用程序的步骤
- 下载重置.o:ExampleFiles_nonSemiHosted.zip
- 复制/备份您现有的Altera链接器脚本 altera-socfPGA 托管.ld
- 更改编译标记
之前:-lcs3hosted
后:-lcs3unhosted: GROUP(-lgcc -lc -lcs3 -lcs3unhosted -lcs3arm)
- 评论或删除以下代码部分:
/* Enable arm semihosting */
EXTERN(__auto_semihosting) /* force exit to be picked up in a hosted or os environment */
EXTERN (exit atexit) - 更新 Makefile 以编译 reset.o,并从步骤 2-4 指向更新的 Linker 脚本
#Assembler Flags
AFLAGS := -g -O0 -mfloat-abi=soft -march=armv7-a -mtune=cortex-a9 -mcpu=cortex-a9 -x assembler
#Assembler source files
A_SRC := reset.s
#Original Linker script
#LINKER_SCRIPT := altera-socfpga_hosted.ld
#Link to updated linker script for non-semihosted
LINKER_SCRIPT := altera-socfpga.ld
#Clause to compile reset.o
reset.o:
-c reset.s -o reset.o
#Updated linker line to add dependency for reset.o
: reset.o
-T reset.o -o
-d > .objdump
> .map
注意:编辑 Makefiles 时,需要确保遵守正确的选项卡和空间规则
此问题从 SOC EDS 版本 14.0 开始修复