FATFS Code Generation for STM32L (CubeMX)
I am using STM32L476VG and I want to write files to a SD card. In CubeMX I generate code for the FAT File System with the following settings:

Moreover, I am using FreeRTOS with static memory allocation only:

However, I have found two issues so far:
- Since the reentrancy setting for FATFS configuration must be enabled when using FreeRTOS, the function ff_cre_syncobj(...) (syscall.c) is called inside f_mount(...) (ff.c). However, since this function does not allocate memory dynamically oder statically, the execution fails. I think the line
osSemaphoreDef(...);is not correct, since there is a dedicated macro
osSemaphoreStaticDef(...);for the static definition of a semaphore. Is this a bug in ff_cre_syncobj(...)?
2. For some reason the setting for USE_LFN (Use Long Filename) is not accepted for code generation. This setting is disabled in CubeMX (see first screenshot) but in ffconf_template.h the lines
#define _USE_LFN 3
#define _MAX_LFN 255
/* The _USE_LFN switches the support of long file name (LFN).
/
/ 0: Disable support of LFN. _MAX_LFN has no effect.
/ 1: Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
/ 2: Enable LFN with dynamic working buffer on the STACK.
/ 3: Enable LFN with dynamic working buffer on the HEAP.
...*/are generated. I also noticed that _USE_LFN can take three distinct values in CubeMX, but as you can see from the file above, the comment suggests that there are four distinct values possible. So why is the generated code not consistent with the CubeMX settings? Can I just (safely) change the value of _USE_LFN manually or might this result in further issues?
