Step 4: Configure File System
A file system is needed to access the files on the flash drive.
Expand the Harmony Framework Configuration > System Services > File System selection tree. Note that MPLAB® Harmony Configurator (MHC) has already selected the Use File System Service? option for you (as described in the previous step).
Expand the Use File System Service?. Keep the Maximum Simultaneous File Access value at 1.
The Size of block is set to 512 and is grayed out.
Keep the Size of Media Flash Page Buffer value at 2048.
This is used to reserve a static buffer of this size in cases where the media block size is higher than 512 bytes. In such cases, a read-modify-write operation is performed. You need to provide a value equal to the block size of the corresponding media (flash drive in this case), for holding one complete block of memory for the read-modify-write operation.
Enable the Use File System Auto Mount Feature?. This causes the USB MSD Host client driver to automatically mount the file system on the drive and then notify the application through SYS_FS_MOUNT_EVENT in the file system event handler registered by the application. Note that in previous MHC versions, mounting of file system was handled by the application when the application received a USB_HOST_MSD_EVENT_ATTACH in the USB Host MSD event handler registered by the application.
Keep the Total Number Of Media value at 1. This application supports only one mass storage media (the flash drive). If the application needed to support 1 flash drive and 1 SD card, then the Total Number Of Media must be set to 2.
Now, the media must be configured. Expand Media 0 > Media Configuration (0) (note the Media 0 box is already checked). Change the Media Type to SYS_FS_MEDIA_TYPE_MSD. This causes the media driver functions to use the USB Mass Storage SCSI functions in order to access the media.
Make sure the File System Type for Media 0 is selected as FAT.
Keep the Number of Volumes value at 1. This reflects the number of valid partitions available on the media. Make sure Volume 1 is selected, and that the Device Name and Media Mount Name are set to /dev/sda1 and /mnt/myDrive1 respectively.
Keep the File System Types value at 1. Note that this setting is different from the File System Type setting present under Media 0.
Some applications could use multiple medias (e.g., one flash drive and one SD card), each using either a FAT file system or the Microchip File System. In this case, you would need to enable support for both FAT File System and the Microchip File System under the File System tab; and then select one of these file systems for each Media under the individual media configuration (example: Media 0) tab.