2018-09-03 02:56 AM
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:
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?
2018-09-03 09:06 AM
> but in ffconf_template.h the lines .... are generated.
This file is template only. What is actually generated in Inc/ffconf.h in your project folder?
-- pa
2018-09-04 02:48 AM
Thanks Pavel. The generated code in Inc/ffconf.h is correct. This answers question 2.
Any ideas/suggestions related to question 1?
2019-03-25 08:15 AM
Hey,
I think I have run into the same problem (Q1). Did you manage to solve it somehow?
2019-04-01 03:56 AM
Unfortunately not, but the answer would still be of use for me.