Enabling LFN configuration in KSDK V. 2 FRDM-K64F USB HOST FATFS demo project causes build errors

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Enabling LFN configuration in KSDK V. 2 FRDM-K64F USB HOST FATFS demo project causes build errors

ソリューションへジャンプ
1,598件の閲覧回数
MAPC
Senior Contributor I

Hi,

 

I don't know if somebody experienced something like that.

 

I'm running KSDK V. 2 FRDM-K64F USB HOST FATFS demo project. Everything works. But, when I enable LFN (long file name) in ffconf.h file, I run into a lot of build errors. I notice that all those errors are caused by ff_memalloc and ff_memfree functions that compiler could find in the project, though they are there.

 

That doesn't make any sense at all, because I didn't change anything in demo project. So, why is this happening? Am I missing something?

 

152640_152640.pnglfn_setttings.png

152641_152641.pngpastedImage_1.png

152642_152642.pngerror_mem_alloc_function_call.png

Can anybody help me on that please?

 

Thanks and best regards,

 

Marco Coelho

Applications Engineer

Siletec Eletronica

ラベル(1)
0 件の賞賛
返信
1 解決策
1,403件の閲覧回数
MAPC
Senior Contributor I

Hi, Colin

In "C:\Freescale\SDK_2.0_MK64FN1M0xxx12\middleware\fatfs_0.11a\src\option", I found "syscall.c" and "ccsbcs.c" files where "ff_malloc", "ff_memfree","ff_convert" and "ff_wtoupper" functions are declared.

I just copied them to my project and those build errors are gone! Incredibly, those files are not included or linked in KSDK demo project, neither their KSDK path are included in Project Compiler Settings.

Thanks for your help!

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,403件の閲覧回数
colin
Contributor III

It sounds like ff_memalloc() etc. are the OS-dependent functions of the FatFs library, and as a user of the library you need to define them.  The FatFs documentation says, "When use heap memory for the working buffer, memory management functions, ff_memalloc and ff_memfree, need to be added to the project."

See this link MakefileBasedBuild/Atmel/sam3x/sam3x-ek/libraries/libfatfs/fatfs/src/option/syscall.c - device/googl...  for and example.  You can implement them to simply delegate to the C standard library malloc() and free() functions.

0 件の賞賛
返信
1,404件の閲覧回数
MAPC
Senior Contributor I

Hi, Colin

In "C:\Freescale\SDK_2.0_MK64FN1M0xxx12\middleware\fatfs_0.11a\src\option", I found "syscall.c" and "ccsbcs.c" files where "ff_malloc", "ff_memfree","ff_convert" and "ff_wtoupper" functions are declared.

I just copied them to my project and those build errors are gone! Incredibly, those files are not included or linked in KSDK demo project, neither their KSDK path are included in Project Compiler Settings.

Thanks for your help!

0 件の賞賛
返信