SDCard Using FatFS without SDK doesn't compile

Hi,

During the development of the firmware over nRF5340, I need to modify the ffconf.h file without changing the SDK. Based on this post I copied the FATFS files into the application root in this way: src/fatfs/<files> and into pro.conf I modified the file in this way:

# SDCard & Filesystem
CONFIG_DISK_DRIVERS=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_DISK_ACCESS=y

# Added FATFS library into application project folder!
CONFIG_FILE_SYSTEM=n
CONFIG_FAT_FILESYSTEM_ELM=n

When I try to compile (pristine build) the project, I receive the following errors:

Y:\Projects\X\src\fatfs\ff.c:4989: multiple definition of `f_mkdir'; app/libapp.a(ff.c.obj):Y:\Projects\X\src\fatfs\ff.c:4989: first defined here
c:/users/warcomeb/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(file.c.obj): in function `f_rename':
Y:\Projects\X\src\fatfs\ff.c:5074: multiple definition of `f_rename'; app/libapp.a(ff.c.obj):Y:\Projects\X\src\fatfs\ff.c:5074: first defined here
c:/users/warcomeb/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(file.c.obj): in function `f_mkfs':
Y:\Projects\X\src\fatfs\ff.c:5808: multiple definition of `f_mkfs'; app/libapp.a(ff.c.obj):Y:\Projects\X\src\fatfs\ff.c:5808: first defined here
c:/users/warcomeb/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(file.c.obj): in function `File_directoryChange':
Y:\Projects\X\src\file.c:177: undefined reference to `fs_opendir'
c:/users/warcomeb/ncs/toolchains/v2.1.2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/../../../../arm-zephyr-eabi/bin/ld.exe: app/libapp.a(file.c.obj): in function `File_init':
Y:\Projects\X\src\file.c:155: undefined reference to `fs_mount'

I can't delete the reference to zephyr module...

Where is it the problem?

Thanks 

Parents Reply
  • Hi Simon,

    Thanks for your time. The problem is that I need a custom ffconf.h and I don't want modify the file into sdk (it is a multi-developer project, so the custom configurations must be in the repository and not into the sdk of each developer). For this reason, I follow the trick of the other post that suggests including the FatFS into the src folder of the application.

    I want to disable the include of zephyr module fatfs and use only the code that put inside the directory!

    Best regards

    Marco

Children
Related