fs_mount fatfs in RAM not working -- "fs mount error (-5)"

Hi, I'm using NCS v2 building on VSCode and failing to mount a RAM-backed fatfs instance.

I looked at the code for the usb mass storage example (link) for the code.

The error I get is: [00:00:00.770,233] <err> fs: fs_mount: fs mount error (-5)

My prj.conf is:

CONFIG_DISK_DRIVER_RAM=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_DISK_RAM_VOLUME_SIZE=32

My code is:

static void setup_disk(void)
{
    static FATFS fat_fs;
    static struct fs_mount_t fs_mnt;
    memset(&fat_fs, 0, sizeof(fat_fs));
    memset(&fs_mnt, 0, sizeof(fs_mnt));

    fs_mnt.type = FS_FATFS;
    fs_mnt.fs_data = &fat_fs;
    fs_mnt.mnt_point = "/RAM:";

    int rc = fs_mount(&fs_mnt);
}

Can you help me understand what I need to do to get this to work?

Thanks.

Parents Reply Children
No Data
Related