This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using fopen() vs f_open() in FatFS in SYSBIOS

Other Parts Discussed in Thread: OMAPL138

Hello,

For file operations should we use the fopen(), fclose() generic calls or f_open() and f_close() as defined in ff.h of bios?

For fopen i am able to do file operations with full path as fat:<driveno>:<filename> 
fat defined in application cfg file as FatFS.fatfsPrefix = "fat";

But for f_open above full path gives an error no 12. I also tried with "/<driveno>/filename" with the same result.

How should be the full path in case of f_open().
Note: If the drive number is 0 then by just giving the filename i am able to create the file.

I am using the bios version: 6_33_01_25
running on DSP core of LCDK with omapl138 

Thanks & regards,
Prasad

  • Prasad,

    The "fat" prefix if meant only for the C RTS function "fopen()".  For the FatFS function "f_open()", this prefix has no meaning.

    The SYS/BIOS FatFS implementation maps the C RTS fopen() to the FatFS function ffcio_open(), which has some extra code to support a flags parameter as well as a file descriptor table.  Eventually it calls f_open().  You can see this in ffcio.c that ships with BIOS.

    We recommend that you use "fopen()" as described in the documentation.

    Steve