Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.
Processor SDK RTOS FATFS
Starting in v4.3, Processor SDK documentation is no longer hosted on processors wiki.
Please bookmark the new links:
- Linux, RT-Linux: http://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/index.html
- RTOS: http://software-dl.ti.com/processor-sdk-rtos/esd/docs/latest/rtos/index.html
- Android: http://software-dl.ti.com/processor-sdk-android/esd/docs/latest/android/index.html
|RTOS Software Developer Guide||→||FATFS|
FATFS module provides an interface to configure a driver for FAT file system compatible device that connects via MMCSD, USB, etc. It configures FATFS for disk operations driver disk Initialize, disk read, disk write
Board Specific Configuration
All board specific configurations eg:enabling clock and pin-mux for UART pins are required before calling any driver APIs.By default Board_Init() API supports all initialization sequence for TI supported EVMs. In addition it initializes UART instance for Console/STDIO.Refer Processor SDK RTOS Board Support for additional details.Once board specific configuration is complete FATFS_init() API can be called to initialize FATFS for the driver.
FATFS Configuration Structure
Application is expected to perform driver specific configuration for FATFS_config structure. The structure supports initialization of multiple drivers for FATFS, i.e. both MMCSD and USB can be configured to use FATFS file system by configuring each driver to different drive instance. This structure must be provided to the FATFS driver. It must be initialized before the FATFS_init() function is called and cannot be changed subsequently. For details about individual fields of this structure, see the Doxygen help:PDK_INSTALL_DIR\packages\ti\fs\fatfs\docs\doxygen\html\index.html.
In order to use the FATFS module APIs, the FATFS.h and ff.h header file should be included in an application as follows:
#include <ti/fs/fatfs/FATFS.h> #include <ti/fs/fatfs/ff.h>
API Call Flow
Below sequence indicates the calling sequence of FATFS driver APIs:
FATFS_Handle FATFS; FATFS_Params FATFSParams; FATFS_Params_init(&FATFSParams); FATFS = FATFS_open(peripheralNum, &FATFSParams);
At this point application can invoke additional FAT File system API eg: f_open(), f_write(), f_read() etc to perform file operations on device
|| Expected Results|
|FATFS Example application||
Example will initialize card and checks for valid FAT partition. When a valid FAT partition is detected console interface for command execution is provided. Supported console commands include ls (to list files of directory), cd (change directory), pwd (present working directory) and cat (text file read operation).
When a card is detected with valid FAT partition console interface output will indicate "0:> "
Additional documentation reference
|API Reference Manual||$(TI_PDK_INSTALL_DIR)\packages\ti\fs\fatfs\docs\doxygen\html\index.html|