从demo工程开始
我使用的是quartus 17.1,在直接使用demo工程时会存在编译问题。如果其它版本有问题,可以根据提示进行同样的修改。
example工程在这个路径下:
intelFPGA\17.1\embedded\examples\software
我们拷贝一个工程Altera-SoCFPGA-HardwareLib-16550-CV-GNU.tar到我们自己的工程目录下解压
然后使用ds-5导入该工程。

编译时,会出现如下错误:
make all
arm-altera-eabi-gcc -g -O0 -Wall -Werror -mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=neon -IC:/Program Files/DS-5 v5.27.1//…/ip/altera/hps/altera_hps/hwlib/include -IC:/Program Files/DS-5 v5.27.1//…/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av -Dsoc_cv_av -c hwlib.c -o hwlib.o
arm-altera-eabi-gcc: error: Files/DS-5: No such file or directory
arm-altera-eabi-gcc: error: v5.27.1//…/ip/altera/hps/altera_hps/hwlib/include: No such file or directory
arm-altera-eabi-gcc: error: Files/DS-5: No such file or directory
arm-altera-eabi-gcc: error: v5.27.1//…/ip/altera/hps/altera_hps/hwlib/include/soc_cv_av: No such file or directory
make: *** [Makefile:83: hwlib.o] Error 1
从上面我们可以看出,头文件找不到,也就是路径不对。那么我们打开工程的属性,看一下常量设置。
我们将其改为soceds路径:
使用hwlib中的其它库文件
比如我们想使用qspi库,我们怎么添加这个库文件呢?

至于每个库文件使用,跟soc架构有关,今后的会陆续更新hwlib编程。
最后记得更换preloader程序才能让程序在你的板子上跑起来。
本文详细介绍了在使用Quartus17.1时遇到的Demo工程编译问题及解决方案。通过修改工程路径和常量设置,解决了头文件找不到的问题。并介绍了如何添加hwlib中的库文件,如qspi库,以及更换preloader程序的方法。




3587





