nrf52840 DK, nRF Connect SDK 2.3.0 using vsCode, FAT Filesystem Sample Application
Working with the FAT_FS sample code, I am able to communicate with the SD card perfectly fine, as far as I can tell. The call to lsdir() functions as expected. However, when calling fs_open() to open a file to write to on an external SD card, it is returning error code -2 IF the filepath (mount point + filename) is longer than 14 characters. If the filepath is less than 14 characters then it will successfully write data. I thought it might be resolved by enabling CONFIG_FS_FATFS_LFN, however it did not work. See the code below for my example.
What does error code -2 mean? I wasn't able to find a clear answer anywhere. Is it the same as ENOENT, found in /zephyr/lib/libc/minimal/include/errno.h?
If I get a little deeper with the error, it fails in fs.c at line 163, in fs_open.
fs.c (in the code snippet below the failure is at line 33)
main.c
Relevant prj.conf settings