FreeRTOS+FAT build warning/error messages

We’ve had good experience with FreeRTOS (thanks!) and I need a filing system quickly so FreeRTOS+FAT seems like the obvious choice. I downloaded the code from github and created a FreeRTOSFATConfig.h file with all the parameters described on the web page, but I’m getting lots of errors and warnings on building e.g. undefined symbols like ffconfig_USE_NOTIFY, USE_SOFT_WDT, FF_NOCASECMP, ffconfigNOT_USED_FOR_NOW (!), ffconfigDEV_SUPPORT, which need to be defined to get the code to build, although I’m guessing what they should be defined as. Various other worrying warnings etc.

Am I missing something? either in which files I’m including in my build, or some documentation somewhere? Or is it possble that the options I’ve selected in my FreeRTOSFATConfig.h have exposed these issues?

A template FreeRTOSFATConfig.h with “vanilla” configuration would be really useful as it’s not at all clear what settings should be selected for some of the options.

regards
Jonathan

Sorry for brevity of reply and no links but I’m on my cell phone. Have you got an example project you can copy the config file from as a starting point? How much RAM can you give to the file system, as that impacts the config setting too.

Thanks for your swift response Richard. I haven’t been able to find any example projects - I can see the description on the web site, but the example code doesn’t seem to be in the distribution package any more - there was a link there to Sourceforge, but again I couldn’t find an example FreeRTOSFATConfig.h.

re RAM, I’m working on a Microchip SAMV71 processor with 384kB of RAM so I could allocate a fair amount of RAM, even up to 64kB if necessary. I’m interfacing to an SD card with 512 byte sectors and was planning to use 4kB clusters as that seems a standard choice.

I relaised after posting that I may be seeing the undefined symbol warnings because I’m compiling with -Wundef - so I guess if I define all those symbols as 0 I’ll get the default behaviour.

regards
Jonathan

Hello @gebjon, apologies for the late response.

Were you able to solve the issue with compilation? Or do you need more help?

Aniruddha

Thanks for reporting these compiler issues.

When FreeRTOS+FAT was developed, it was assumed that undefined macros are silently replaced by zero in an #if expression:

#if( UNDEFINED_MACRO != 0 )
    extern unsigned foo;
#endif

The macro’s that you mention:

USE_SOFT_WDT              // When true. a user-provided function `clearWDT()` will be called regularly.
FF_NOCASECMP              // This macro disappeared in later versions
ffconfig_USE_NOTIFY       // Disappeared
ffconfigNOT_USED_FOR_NOW  // A trick to block out code from compilation, needs clean-up
ffconfigDEV_SUPPORT       // A rarely used feature of FreeRTOS+FAT

should all have been defined as 0 by default. I will prepare a pull request that will add them to FreeRTOSFATConfigDefaults.h.

Thanks Hein, yes I had realised that they should probably be defined as 0, and in fact were being reported by the compiler because I use gcc with the -Wundef option which reports exactly this issue.
FF_NOSTRCASECMP is still in the current master version of ff_dir.c, and ffconfigUSE_NOTIFY is still in ff_stdio.c.

I just submitted PR #21 for the above compiler issue: “FAT: Changes for 64-bit platforms and solved compiler warnings”.
It also addresses some other issues like some casts in ff_stdio.h.