Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


+FAT Unicode file names and ff_fopen()

Posted by sonycman on June 5, 2017


I`am using +FAT version 160919FreeRTOSLabs UTF-16 unicode support is enabled by setting ffconfigUNICODEUTF16SUPPORT to 1. Long file names support is enabled also by setting ffconfigLFN_SUPPORT to 1.

That would let me to use filenames in unicode, i supposed.

But how can I pass a unicode string to ff_fopen() function, if its pcFile parameter have the type of const char *?

How could one open a file which filename is a unicode string?

Regards Vladimir

+FAT Unicode file names and ff_fopen()

Posted by heinbali01 on June 6, 2017

Vladimir, I am guessing that you want to see file names in Cyrillic?

The Unicode variant of the library ( ffconfigUNICODE_UTF16_SUPPORT ) has been tested, but it was never included into the top layer: ff_stdio.c

When you use the low-level functions like FF_Open(), you do have Unicode, but you will miss the "file system layer". Which is no problem if you just have a single volume, an SD-card.

I think I would define a type that holds a character ( of file name ) :

~~~ #if( ffconfigUNICODEUTF16SUPPORT != 0 ) typedef FFTWCHAR FileNamet; #else typedef const char FileNamet; #endif

FF_FILE *ff_fopen( FileName_t *pcFile, const char *pcMode );
int ff_mkdir( FileName_t *pcPath );
int ff_rmdir( FileName_t *pcDirectory );
int ff_remove( FileName_t *pcPath );


+FAT Unicode file names and ff_fopen()

Posted by heinbali01 on June 6, 2017

Just checked the above change with ff_stdio.c I'm afraid it is a lot more work because there are lots of manipulations with the file- and directory-names. Also ff_sys.c will need to be adapted to use Unicode. No quick fix available, I'm afraid

+FAT Unicode file names and ff_fopen()

Posted by sonycman on June 6, 2017

Hi, Hein.

Vladimir, I am guessing that you want to see file names in Cyrillic?

Exactly! I was very confused realising that Unicode enabled file system actually does not support it from the top layer. But I'am understand its still in development and unfinished.

Maybe, I should try an ANSI OEM code page for extra cyrillic symbols? Windows 1251 suits me best. That will let me use the existing top layer interface, with insertion of conversion function (OEM to UTF-16 and vice versa) before making calls to native UTF-16 layer.

I need fffopen(), fffindfirst() and ff_findnext() only for now.

I will be appreciated for any advices.

PS: I'am very liked +FAT at the moment. Sectors caching and consecutive clusters read (in one driver function call!) is a very nice features!

[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists