Follwing table shows which function is removed by configurationoptions for the module size reduction.
下面的表显示了通过设置配置选项哪些函数将会移除,进而减小模块大小
Function | _FS_MINIMIZE | _FS_READONLY | _USE_STRFUNC | _USE_MKFS | _USE_FORWARD | ||
1 | 2 | 3 | 1 | 0 | 0 | 0 | |
f_mount | |||||||
f_open | |||||||
f_close | |||||||
f_read | |||||||
f_write | x | ||||||
f_sync | x | ||||||
f_lseek | x | ||||||
f_opendir | x | x | |||||
f_readdir | x | x | |||||
f_stat | x | x | x | ||||
f_getfree | x | x | x | x | |||
f_truncate | x | x | x | x | |||
f_unlink | x | x | x | x | |||
f_mkdir | x | x | x | x | |||
f_chmod | x | x | x | x | |||
f_utime | x | x | x | x | |||
f_rename | x | x | x | x | |||
f_mkfs | x | x | |||||
f_forward | x | ||||||
f_putc | x | x | |||||
f_puts | x | x | |||||
f_printf | x | x | |||||
f_gets | x |
The FatFs module supports long file name (LFN) from revision 0.07.The two different file names, SFN and LFN, of a file is transparentin the file functions except for f_readdir function. The LFNfeature requiers a certain working buffer in addition. The buffersize can be configured by _MAX_LFN corresponding to the availablememory size. The size of long file name will reach up to 255characters, so that the _MAX_LFN should be set to 255 for fullfeatured LFN operation. When the size of working buffer isinsufficient for the given file name, the file function will failwith FR_INVALID_NAME.
FatFs从0.07版本开始支持长文件名(LFN)。在调用文件函数时,一个文件的两个文件名(SFN与LFN)是通用的,除了f_readdir函数。支持长文件特性将需要一个额外的工作缓冲区,此缓冲区的大小可以通过设置_MAX_LFN来以可用的内存大小相符。因为长文件名长达255个字符,因此_MAX_LFN应该设置为255来支持全特性的LFN选项。当工作缓冲区的大小容不下给出的文件名时文件函数就会因为FR_INVALID_NAME而调用失败。
LFN cfg on ARM7DMI Code page ROM size [bytes]SBCS +4719932(Shift-JIS) +63755936(GBK) +178943949(Korean) +141003950(Big5) +112631
When LFN is enabled, the module size will be increased depends onthe selected code page. Right table shows the difference in modulesize between the conditions that LFN is disabled and enabled onsome code pages. We are the Japanese, Chinese and Korean have tensof thousands of characters. Unfortunately, it requires a hugeOEM-Unicode bidirectional conversion table and the module size willbe drastically increased that shown in the table. As the result,the FatFs with LFN enabled will not able to be implemented to most8-bit microcontrollers including AVR. This is the reason why I hadnot been interested in implementing the LFN feature for a long time:-)
当使能LFN,模块增加的大小由编码页类型决定,右边的表显示了LFN禁用与使用某些编码来使能时模块的不同大小。日语、中文与韩国语拥有成千上万的字词,而不幸的是,将需要一个巨大的OEM-Unicode双向转换表,模块的大小将大大的增大,如表所示。因此,使能LFN的FatFs将不能在包括AVR在内的大多数8位微控制器上使用。这也是为什么我长期以来对实现LFN特性不感兴趣:-).
Note that the LFN feature on the FAT file system is a patent ofMicrosoft Corporation. When enable it on the commercial products, alicense from Microsoft may be required depends on the finaldestination.
请注意:FAT文件系统的LFN特性是微软公司的专利。当在商用产品上使用时,根据最终目的的不同可能需要获得微软的许可证。
联系客服