在修改了BD的部分代码之后,重新综合工程生成bit,之后刷新hdf文件,在SDK端就出现了SD卡相关的函数未定义的报错:
Description Resource Path Location Type
E:\Work\VivadoPrj\Prj1\project_1\project_1.sdk\Test\Debug/…/src/helloworld.c:177: undefined reference to f_mkfs' Test C/C++ Problem E:\Work\VivadoPrj\Prj1\project_1\project_1.sdk\Test\Debug/../src/helloworld.c:246: undefined reference to
f_open’ Test C/C++ Problem
E:\Work\VivadoPrj\Prj1\project_1\project_1.sdk\Test\Debug/…/src/helloworld.c:254: undefined reference to f_lseek' Test C/C++ Problem E:\Work\VivadoPrj\Prj1\project_1\project_1.sdk\Test\Debug/../src/helloworld.c:262: undefined reference to
f_write’ Test C/C++ Problem
E:\Work\VivadoPrj\Prj1\project_1\project_1.sdk\Test\Debug/…/src/helloworld.c:277: undefined reference to `f_close’ Test C/C++ Problem
解决方法:
1.首先打开bsp的system.mss文件,滑到最下面,导出一个SD卡读写的Demo
2.之后编译这个生成的demo,可以看到没有报错
3.打开demo的Debug/Src/objects.mk,可以看到LIBS里面有-lxilffs
4.之后再打开自己的Test工程下的Debug/Src/objects.mk文件,可以看到是缺少了关于SD卡相关的库的
5.直接把demo的这段抄过来就解决了。