Skip to content

Instantly share code, notes, and snippets.

@lixingcong
Last active September 25, 2017 13:15
Show Gist options
  • Select an option

  • Save lixingcong/0cdecf3440e7aa1475ab6429fdd2c74b to your computer and use it in GitHub Desktop.

Select an option

Save lixingcong/0cdecf3440e7aa1475ab6429fdd2c74b to your computer and use it in GitHub Desktop.
Xilinx SDK工程for Eclipse

Eclipse新建一个C/C++工程

工程属性:新建几个环境变量用于后面查找

# SDK_ROOT
D:\Program_Files\Xilinx\SDK\2015.4

# BOOTGEN
${SDK_ROOT}\bin\unwrapped\win64.o

# GNUWIN
${SDK_ROOT}\gnuwin\bin

# TOOLCHAIN
${SDK_ROOT}\gnu\arm\nt\bin

然后添加到PATH变量中

${TOOLCHAIN};${GNUWIN};${BOOTGEN};

C\C++ Build->Settings->Tool Settings

Cross Setting:

前缀arm-xilinx-eabi-

Cross GCC compiler和Cross G++ compiler同样修改:

Includes添加合适的目录(在这里添加可以多选目录,比在build path and symbols那里添加目录方便),它会自动同步设置到C/C++ General的Path and Symbols下面。

Miscellaneous:替换为

-c -fmessage-length=0 -MT"$@"

Cross GCC(G++) Linker:

Expert Settings(专家设置):替换为

${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} -Wl,--start-group,-lxil,-lgcc,-lc,--end-group,-lm -Wl,-Map,mapfile.map

Libraries的搜索路径添加libxil.a所在目录:添加

../../ZYNQ_TEST_PROJECT_bsp/ps7_cortexa9_0/lib

Miscellaneous的linker flags:替换为

-Wl,-T -Wl,../src/lscript.ld

Miscellaneous的other objs其他目标:添加*.a

C\C++ Build->Settings->Build Steps

照抄

bootgen -image ${workspace_loc:/${ProjName}/bootimage}/ZYNQ_TEST_PROJECT.bif -o ${workspace_loc:/${ProjName}/bootimage}/A9Test.bin -w on

C\C++ Build->Settings->Build Artifact:

指定后缀elf

修改bootimage下的bif文件

改为合适的工程名字和elf,否则bootgen.exe找不到elf文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment