cancel
Showing results for 
Search instead for 
Did you mean: 

FATFS UTF-8 support

MZadn.2
Associate II

I am using STM32CubeMX 6.16.1 to configure a project for STM32F415.

I use the FATFS on SD card and set it up as:

MZadn2_3-1778741085479.png

According to FATFS documentation (https://elm-chan.org/fsw/ff/doc/config.html#lfn_unicode), the data type TCHAR should translate to char in this case. However, CubeMX generates Middlewares/Third_Party/FatFs/src/ff.h in which TCHAR is defined as WCHAR, i.e. a 16-bit type:

MZadn2_1-1778740933914.png

The _STRF_ENCODE is correctly defined as 3 in FATFS/Target/ffconf.h, which corresponds to UTF-8:

MZadn2_2-1778740998616.png

Is this a bug? How can I ensure that UTF-8 uses the 8-bit data type correctly?

0 REPLIES 0