This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FAT file error

Hi,

we are trying to use FAT file in nRF9160. Referring the test case in "ncs\zephyr\tests\subsys\fs\multi-fs\src" to mount the FAT file.

But getting an error like "ff.h" not found:

../src/main.c:24:10: fatal error: ff.h: No such file or directory
#include <ff.h>

Code tried:

#define FATFS_MNTP "/RAM:"
#define TEST_FILE FATFS_MNTP"/testfile.txt"
#define TEST_DIR FATFS_MNTP"/testdir"
#define TEST_DIR_FILE FATFS_MNTP"/testdir/testfile.txt"

static FATFS fat_fs;

static struct fs_mount_t fatfs_mnt = {
.type = FS_FATFS,
.mnt_point = FATFS_MNTP,
.fs_data = &fat_fs,
};

void main(void)
{
int res;
res = fs_mount(&fatfs_mnt);
if (res < 0) {
printk("Error mounting fs [%d]\n", res);
return 0;
}}

Help us to resolve the error or please point us to the sample code/application to store the content in file system.

And what all are ways to persist  the settings/content in nRF9160 ?

Thanks,
Bala

 

Parents
  • Hello Bala, 

    But getting an error like "ff.h" not found:

    ../src/main.c:24:10: fatal error: ff.h: No such file or directory
    #include <ff.h>

    Yes, you are correct, the file is not included in NCS. I'm not sure if this is intentionally or a mistake, will forward to our NCS team. I can not guarantee that this sample works with nRF9160 out of the box, as I see that the official Zephyr sample FAT Filesystem Sample Application  states:

    This sample can be built for an nrf52840_blip board

    What files did you try? The file ff.h is available through the nRF52 SDK, perhaps you could use this file as a work-around?

    More information found here, here and here

Reply
  • Hello Bala, 

    But getting an error like "ff.h" not found:

    ../src/main.c:24:10: fatal error: ff.h: No such file or directory
    #include <ff.h>

    Yes, you are correct, the file is not included in NCS. I'm not sure if this is intentionally or a mistake, will forward to our NCS team. I can not guarantee that this sample works with nRF9160 out of the box, as I see that the official Zephyr sample FAT Filesystem Sample Application  states:

    This sample can be built for an nrf52840_blip board

    What files did you try? The file ff.h is available through the nRF52 SDK, perhaps you could use this file as a work-around?

    More information found here, here and here

Children
Related