UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
251 Views
Registered: ‎09-29-2018

SDK undefined reference

Jump to solution

Hi,

I was using xilffs to get file system data from SD card. In BSP setting, I enabled xilffs. the initial compile works file. However, after a few days, when re-open the project, the whole project always need to be recompiled (seems common to SDK). Then I ran into an error: undefined reference to f_mount. The only way I can fix is to unselect the xilffs in BSP, let it compile, then re-select it. Then error is gone.

Here's the error:

'Building target: zcu106_dptxsf.elf'
'Invoking: ARM v8 gcc linker'
aarch64-none-elf-gcc -Wl,-T -Wl,../src/lscript.ld -L../../zcu106_dptxsf_bsp/psu_cortexa53_0/lib -o "zcu106_dptxsf.elf" ./src/clk_set.o ./src/idt_8t49n24x.o ./src/menus.o ./src/ti_lmk03318.o ./src/xdptxss_zcu106_dp14_tx.o ./src/xedid_print_example.o ./src/xvid_pat_gen.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: ./src/xdptxss_zcu106_dp14_tx.o: in function `DDR_Pic_Layer_Initialize':
C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2368: undefined reference to `f_mount'
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2375: undefined reference to `f_mount'
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2382: undefined reference to `f_open'
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2395: undefined reference to `f_lseek'
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2401: undefined reference to `f_read'
c:/xilinx/sdk/2019.1/gnu/aarch64/nt/aarch64-none/bin/../lib/gcc/aarch64-none-elf/8.2.0/../../../../aarch64-none-elf/bin/ld.exe: C:\FPGA2019p1\DP\zcu106_dptxsf\dptxsf.sdk\zcu106_dptxsf\Debug/../src/xdptxss_zcu106_dp14_tx.c:2440: undefined reference to `f_close'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:38: zcu106_dptxsf.elf] Error 1

If open declaration of "f_mount", I can see it in the file ff.h. 

I searched online and found the following link:https://forums.xilinx.com/t5/Embedded-Development-Tools/SDK-undefined-reference/td-p/818300

Followd that, in my application project, I modified the Software Platform Inferred Flags, and add -lxiffs, re-compile shows in-correct path. Only when I modified the BSP as shown above, the link path can be found. 

Is there a way to prevent this from happening? 

Thanks and Regards,

Michelle

 

0 Kudos
1 Solution

Accepted Solutions
Moderator
Moderator
211 Views
Registered: ‎09-12-2007

Re: SDK undefined reference

Jump to solution

I dont see the library added here (should be -lxilffs)

 

aarch64-none-elf-gcc -Wl,-T -Wl,../src/lscript.ld -L../../zcu106_dptxsf_bsp/psu_cortexa53_0/lib -o "zcu106_dptxsf.elf" ./src/clk_set.o ./src/idt_8t49n24x.o ./src/menus.o ./src/ti_lmk03318.o ./src/xdptxss_zcu106_dp14_tx.o ./src/xedid_print_example.o ./src/xvid_pat_gen.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group

Can you right click on the app, and select C/C++ build settings. Then under linker, libraries select the + icon and add xilffs

0 Kudos
4 Replies
Moderator
Moderator
212 Views
Registered: ‎09-12-2007

Re: SDK undefined reference

Jump to solution

I dont see the library added here (should be -lxilffs)

 

aarch64-none-elf-gcc -Wl,-T -Wl,../src/lscript.ld -L../../zcu106_dptxsf_bsp/psu_cortexa53_0/lib -o "zcu106_dptxsf.elf" ./src/clk_set.o ./src/idt_8t49n24x.o ./src/menus.o ./src/ti_lmk03318.o ./src/xdptxss_zcu106_dp14_tx.o ./src/xedid_print_example.o ./src/xvid_pat_gen.o -Wl,--start-group,-lxil,-lgcc,-lc,--end-group

Can you right click on the app, and select C/C++ build settings. Then under linker, libraries select the + icon and add xilffs

0 Kudos
Adventurer
Adventurer
189 Views
Registered: ‎09-29-2018

Re: SDK undefined reference

Jump to solution

@stephenm 

Thanks. I will give it a try when I run into this problem again. 

Regards,

Michelle

0 Kudos
Moderator
Moderator
171 Views
Registered: ‎09-12-2007

Re: SDK undefined reference

Jump to solution

Ok, mark this as solved please. This will help others with similar issue

0 Kudos
Adventurer
Adventurer
148 Views
Registered: ‎09-29-2018

Re: SDK undefined reference

Jump to solution

Just verified it and it works. Thanks!

 

Regards,

Michelle

0 Kudos