Hi Mark
Thanks for your online support. I managed to integrate the terminal screen into my application and still I got the same issues. I know the uFAT code is the same in both utasker and my project, and I know I have plenty of memory. So looking at my config file I noticed the issue was that the #ifdef UTFAT_LFN_READ was commented out , so I changed this and now had the same as the uTasker project. Below is the settings for both my project, and uTasker Project.
I was then able to see the files and directories with the console on my code. After rebuilding my own project I then ran into an issue, which I replicated on the uTasker project. I have 2 file handles pointing to the same file.The first handle creates the file, the other handle opens the file for read (manage mode). I placed the following right after I create a directory on the uTasker project.
UTFILE fdWTest,fdRTest; //both lines are global , and ptr_utDirectory was previously initialised.
int Ret1,Ret2;
Ret1=utOpenFile("\\Index.dat", &fdWTest, ptr_utDirectory,UTFAT_OPEN_FOR_WRITE | UTFAT_OPEN_FOR_READ | UTFAT_CREATE); //file created
Ret2=utOpenFile("\\Index.dat", &fdRTest, ptr_utDirectory,UTFAT_OPEN_FOR_READ | UTFAT_MANAGED_MODE ); //same file open for read in manage mode,
Ret1 returned fine, and the file was created (I see this in a DIR command) , but Ret2 returned -6 (UTFAT_FILE_NOT_FOUND). If I commented out UTFAT_LFN_READ in my config , works fine as far as both files are opened, and my application runs as expected. But I cant see the files (original issue).
I dont want to use the "long file Names" so I commented out UTFAT_LFN_READ,UTFAT_LFN_WRITE, UTFAT_LFN_WRITE_PATCH,UTFAT_LFN_DELETE but the compiler threw errors out, see attachment
////CONFIG
#define SD_CARD_RETRY_INTERVAL 5 // attempt SD card initialisation at 5s intervals
#define UT_DIRECTORIES_AVAILABLE 5 // this many directories objects are available for allocation
#define UTMANAGED_FILE_COUNT 10 // allow this many managed files at one time
#define UTFAT_LFN_READ // enable long file name read support
#ifdef UTFAT_LFN_READ
#define MAX_UTFAT_FILE_NAME (100) // the maximum file name length supported
#endif
#define UTFAT_WRITE // enable write functions
#ifdef UTFAT_WRITE
#define UTFAT_FORMATTING // enable formatting SD cards (requires also write)
#endif
#define UTFAT_FULL_FORMATTING
#define UTFAT_LFN_WRITE
#define UTFAT_LFN_WRITE_PATCH
// #define SD_CONTROLLER_AVAILABLE
Best Regards
Neil