2018-03-18 05:37 AM
Hello,
In CubeMx, when the option USE_LFN is enabled, the code generator doesnt generate all necessary code. The missing files are supposed to be in this directory:
Middlewares\Third_Party\FatFs\src\option\
There are no unicode.c and ccXXX.c files (the last depends on the CODE_PAGE). Because of that, no unicode support functions are available:
/* Unicode support functions */
&sharpif _USE_LFN /* Unicode - OEM code conversion */WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */WCHAR ff_wtoupper (WCHAR chr); /* Unicode upper-case conversion */&sharpif _USE_LFN == 3 /* Memory functions */void* ff_memalloc (UINT msize); /* Allocate memory block */void ff_memfree (void* mblock); /* Free memory block */&sharpendif&sharpendifI would appreciate a confirmation of this. Looking forward to your answer.
#fatfs2018-03-19 05:18 AM
Correct, the needed code page file is not copied by CubeMX. You can copy the desired code page file manually from the firmware library installation directory.
2018-03-19 01:07 PM
Thanks for answer,
But do you mean this is by design or is it a bug? Because if this is a feature it doesn't really make sense...
2018-03-19 01:34 PM
I don't know the answer to that question. I would hope that this is just an oversight or that it is on the TODO list. Maybe some from ST will chime in here.
2018-03-19 01:59 PM
Not sure who the point person here for that. Perhaps they can use current version also.
2018-03-20 03:56 AM
Hi
Przenioslo.Lukasz
I have tried to reproduce, but without knowing much about the configuration and the scenario (new project? old one imported?), I do not know and cannot really figure out what could be the source of the issue.
Would be great to get more information so that we can investigate where the issue is.
- OS: Windows / Linux / Mac OS ?
- CubeMx version: 4.0 (or older) ?
- STM32 series/mcu used ?
- Fatfs parameters settings (USE_LFN? CODE_PAGE? LFN_UNICODE? ...) ?
On my side, using CubeMx 4.0, Windows OS 7, F4 series (supporting FatFS R0.12c in CubeMx), playing with some (USE_LFN=3, CODE_PAGE=Japanese, with/without LFN_UNICODE), and creating new project for IAR Ewarmand forTrueStudio as well, files are copied in the option folder created and the functions you mention are found in syscall.c (ff_memalloc and ff_memfree) and the ccXXX.c file, cc9c file in my example, for Japanese mode (
ff_wtoupper and ff_convert).
Regards,
Fred
2018-03-21 04:37 AM
Hello Fred,
Let me write everything here:
- OS: Windows 10 64 bit
- CubeMx vesrion: 4.23.00
- MCU used: STM32L452VE
- Fat parameters:
I am generating the code for truestudio.