HI 各位
我使用TI自帶的 C:\ti\simplelink_msp432p4_sdk_3_20_00_06\source\third_party\fatfs 套件
與官方範例。 fatsdraw
執行時一切正常。
想使用exFat檔案格式時,修改了ffconf.h其中的
#define FF_FS_EXFAT 1
#define FF_USE_LFN 3
然後重新編譯
更換一張exFAT格式的SD卡,重新執行範例卻無法正常跑出結果。
請問是否有地方沒注意到?
感謝回覆
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
HI 各位
我使用TI自帶的 C:\ti\simplelink_msp432p4_sdk_3_20_00_06\source\third_party\fatfs 套件
與官方範例。 fatsdraw
執行時一切正常。
想使用exFat檔案格式時,修改了ffconf.h其中的
#define FF_FS_EXFAT 1
#define FF_USE_LFN 3
然後重新編譯
更換一張exFAT格式的SD卡,重新執行範例卻無法正常跑出結果。
請問是否有地方沒注意到?
感謝回覆
您的#define FF_MAX_LFN 255定义的是多少?请注意文件内的说明
When use heap memory for the working buffer, memory management functions, ff_memalloc() and ff_memfree(), must be added to the project.
当您使用HEAP(3: Enable LFN with dynamic working buffer on the HEAP.)时,您需要添加ff_memalloc() 和 ff_memfree()
感謝您的回覆
我的 FF_MAX_LFN 定義是 255 (ffconf.h)
然後再ffsystem.c裡面也有ff_memalloc()跟ff_memfree()了,底下是ffsystem.c的片段
#include "ff.h" extern void *malloc(size_t size); extern void free(void *ptr); #if FF_USE_LFN == 3 /* Dynamic memory allocation */ /*------------------------------------------------------------------------*/ /* Allocate a memory block */ /*------------------------------------------------------------------------*/ void* ff_memalloc ( /* Returns pointer to the allocated memory block (null on not enough core) */ UINT msize /* Number of bytes to allocate */ ) { return (malloc(msize)); /* Allocate a new memory block with POSIX API */ } /*------------------------------------------------------------------------*/ /* Free a memory block */ /*------------------------------------------------------------------------*/ void ff_memfree ( void* mblock /* Pointer to the memory block to free (nothing to do for null) */ ) { free(mblock); /* Free the memory block with POSIX API */ } #endif #if FF_FS_REENTRANT /* Mutal exclusion */