cancel
Showing results for 
Search instead for 
Did you mean: 

How to use LFN Feature in FatFs to change default 8.3 file Format

Aditya Tiwari
Associate II
Posted on February 22, 2018 at 13:42

Hello there,

I am working on MSD Bootloader which I successfully Implemented  in STM32F207VETx. However while working I found that t

he default build expect 8.3 format file names, and not Long File Names (LFN).

I tried using LFN by making following changes in ffconf.h

&sharpdefine _CODE_PAGE 437

&sharpdefine _USE_LFN 1    /* 0 to 3 */ / When enable the LFN feature, Unicode handling functions (option/unicode.c) must

/ be added to the project.

&sharpdefine _MAX_LFN 40    /* Maximum LFN length to handle (12 to 255) */

&sharpdefine _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */

&sharpdefine _STRF_ENCODE 0

and getting the following error undefined reference to `ff_convert' 

which I think is a function in unicode.c 

So My question is where can I Find Unicode handling functions as i want to give a long name for my file

#tilen-majerle #clive-one
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on February 22, 2018 at 14:23

You might want to migrant to a more current version of FatFS, sounds like you are at 0.09 or something.

You would need to add the CCSBCS.C file to your project to get ff_convert(), ff_wtoupper(), etc

There should be an equivalent in the F2 SPL trees too

\STM32F4xx_DSP_StdPeriph_Lib_V1.8.0\Utilities\Third_Party\fat_fs\src\option\ccsbcs.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

3 REPLIES 3
Andrew Neil
Evangelist III
Posted on February 22, 2018 at 13:56

Note that FatFs is a 3rd-party product - entirely unrelated to ST.

FatFs documentation is here: 

http://elm-chan.org/fsw/ff/00index_e.html

 

FatFs User Forum: 

http://elm-chan.org/fsw/ff/bd/

 
Posted on February 22, 2018 at 14:23

You might want to migrant to a more current version of FatFS, sounds like you are at 0.09 or something.

You would need to add the CCSBCS.C file to your project to get ff_convert(), ff_wtoupper(), etc

There should be an equivalent in the F2 SPL trees too

\STM32F4xx_DSP_StdPeriph_Lib_V1.8.0\Utilities\Third_Party\fat_fs\src\option\ccsbcs.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Aditya Tiwari
Associate II
Posted on February 23, 2018 at 11:10

Thanks Andrew and Clive1 for your support.

Your Answers were really helpful and I successfully changed the default 

8.3 format file names to Long File Name(LFN).

I migrated the code from 

CCSBCS.C file to my project to get ff_convert(), ff_wtoupper(), and changed the format to my desired length.

However,

I have another question for you, Is it possible that I can download a file in .DFU format using MSD Bootloader  as by default it supports .BIN file. If YES then how?