fatfs长文件名及模块剪裁问题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
fatfs长文件名及模块剪裁问题
减小模块大小
Follwing table shows which function is removed by configuration options for the module size reduction.
下面的表显示了通过设置配置选项哪些函数将会移除,进而减小模块大小
长文件名
The FatFs module supports long file name (LFN) from revision 0.07. The two different file names, SFN and LFN, of a file is transparent in the file functions except for f_readdir function. The LFN feature requiers a certain working buffer in addition. The buffer size can be configured by _MAX_LFN corresponding to the available memory size. The size of long file name will reach up to 255 characters, so that the _MAX_LFN should be set to 255 for full featured LFN operation. When the size of working buffer is insufficient for the given file name, the file function will fail with 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 +4719
932(Shift-JIS) +63755
936(GBK) +178943
949(Korean) +141003
950(Big5) +112631
When LFN is enabled, the module size will be increased depends on the selected code page. Right table shows the difference in module size between the conditions that LFN is disabled and enabled on some code pages. We are the Japanese, Chinese and Korean have tens of thousands of characters. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased that shown in the table. As the result, the FatFs with LFN enabled will not able to be implemented to most 8-bit microcontrollers including AVR. This is the reason why I had not 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 of Microsoft Corporation. When enable it on the commercial products, a license from Microsoft may be required depends on the final destination.
请注意:FAT文件系统的LFN特性是微软公司的专利。
当在商用
产品上使用时,根据最终目的的不同可能需要获得微软的许可证。