Module Memory Usage and Configuration

The size of the Petit FatFS module when compiled using AVR-GCC varies between 1 kB-4 kB depending on configuration and optimization settings used. The table below shows example compile sizes with different configuration options, using Atmel Studio 7.0 with optimization for size. Default configuration is with _USE_READ and _FS_FAT16 enabled, and all other options disabled. These approximations are for the Petit FatFs module only, and does not include the disk I/O layer.

Table 1. Example Memory Usage of the Petit FatFs Module
  Size [bytes]
Flash (Default configuration) 2064
Flash (!_USE_READ) -416
Flash (_USE_DIR) +688
Flash (_USE_LSEEK) +556
Flash (_USE_WRITE) +486
SRAM (bss) 1
SRAM (data) 42

Configuration can be customized according to what functions are required by the application. The following table shows which functions are removed for each configuration option, contained in the configuration header file (pffconf.h).

Table 2. Functions Removed by Configuration Options
Function _USE_READ 0 _USE_DIR 0 _USE_LSEEK 0 _USE_WRITE 0
pf_mount        
pf_open        
pf_read x      
pf_lseek     x  
pf_opendir   x    
pf_readdir   x    
pf_write       x