host_msd_fatfs
Overview
This Host FatFs example supports UFI and SCSI U-disk device.
The application prints the attached device information when U-disk device is attached.
The application executes some FatFs APIs to test the attached device.
System Requirement
Hardware requirements
Mini/micro USB cable
USB A to micro AB cable
Hardware (Tower module/base board, and so on) for a specific device
Personal Computer (PC)
Software requirements
The project path is:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_host_msd_fatfs/ / .
The
is Bare Metal or FreeRTOS OS.
Getting Started
Hardware Settings
Set the hardware jumpers (Tower system/base module) to default settings.
Prepare the example
Download the program to the target board.
Power off the target board and power on again.
Connect devices to the board.
For detailed instructions, see the appropriate board User’s Guide.
Run the example
Connect the board UART to the PC and open the COM port in a terminal tool.
Make sure to use a USB HUB or an adapter with OTG functionality firstly. Plug in a U-disk device to the board. The attached information prints out in the terminal.
The test information prints in the terminal. The “success” message prints when a FatFs API succeeds. The “fail” message prints when a FatFs API fails. The test completes when either the FatFs API fails or all the tests are done.
The following figure is an example for attaching one U-disk device.To test the throughput, set the MSD_FATFS_THROUGHPUT_TEST_ENABLE to (1) in the file host_msd_fatfs.h. An additional 64 K RAM is required to test the throughput. The macro is only supported on TWR-K65F180M Tower System module and IAR IDE.
The throughput test process is as follows:Enable MSD_FATFS_THROUGHPUT_TEST_ENABLE.
Format the U-disk in the PC. Select the “Allocation unit size” 32 K.
Insert the U-disk. The throughput test starts.
The following image shows an example.
The throughput test only supports the TWR-K65F180M Tower System module.
LFN (long file name) can be enabled by changing the macro FF_USE_LFN as 1.
Supported Boards
MIMXRT1170-EVKB
EVK-MIMXRT1064
MIMXRT685-AUD-EVK
MIMXRT1060-EVKB
EVK-MIMXRT1010
MIMXRT1040-EVK
FRDM-MCXN947
MIMXRT1024-EVK
LPCXpresso55S36
MIMXRT1060-EVKC
MIMXRT1160-EVK
MIMXRT1180-EVK
EVK-MIMXRT1020
MIMXRT700-EVK
EVK-MIMXRT595
EVK-MIMXRT685
EVKB-IMXRT1050
RD-RW612-BGA
EVK-MIMXRT1015
FRDM-MCXN236
FRDM-RW612