Step 3: Configure USB Library (Mass Storage Host)
Expand the Harmony Framework Configuration > USB Library selection tree and check the Use USB Stack? box.
The USB library is dependent on the Timer System Service for maintaining internal timing requirements. MHC knows this, so it enables the Timer System Service for you. Note the Use Timer System Service? option has been selected under the "System Services > Timer" selection tree.
MHC also knows the Timer System Service needs a Timer driver to function, so it enables this for you too. Note the Use Timer Driver? option has been selected under the Harmony Framework > Configuration > Drivers > Timer selection tree. Observe that MHC has configured Timer Instance 0 to use the Timer1 peripheral (TMR_ID_1).
The Interrupt Mode is checked by default. Keep this selection.
Expand the Select Host or Device Stack option. Un-check the USB Device option and check the USB Host (Recommended) option.
Keep the Host Speed as USB_SPEED_HIGH. The PIC32MZ Host supports both Full Speed and High Speed operations. Selecting High Speed allows the device to work at both Full Speed and High Speed.
Keep the Number of Devices to the default value of 1.
Keep the Number of TPL Entries to 1. The TPL (Targeted Peripheral List) allows the USB host to focus on specific USB devices. For Mass Storage Class, the Host Layer attaches the MSD Host Client Driver to a device when the class, subclass and protocol fields in the Interface Descriptor matches the entry in the TPL table. The following code shows a TPL table design for matching MSD Devices.
This shows that the Host Layer attaches the USB_HOST_MSD_INTERFACE driver whenever the class code, sub-class code and protocol code in the USB interface descriptor of the device matches 0x08 (Class code : Mass Storage), 0x06 (Sub-class code: SCSI transparent command) and 0x50 (Protocol code : Bulk-only Transfer).
Keep the Host Max Interface per Device at 5. This defines the maximum number of interfaces the host can support.
If the attached device's configuration descriptor indicates 4 interfaces, then the Host Max Interface per Device value should be a minimum of 4, or the device will not be processed by the USB host layer. The mass storage device descriptors define only one interface, so the Host Max Interface per Device may be changed to 1.
Since this is a USB MSD Host application, check the Use MSD Host Client Driver box.
MHC knows the USB MSD Host Client Driver is dependent on the File System Service, so it enables this for you. Note the Use File System Service? option has been selected under the "System Services > File System" selection tree. Observe MHC has configured the File System type to FAT.
Keep the Number of MSD Host Driver Instances at 1. This defines the maximum number of MSD Host Driver instances. If you wanted to support two flash drives, then you would set this value to 2.