Adrian Rockall

fsl_usb_framework host file system

Discussion created by Adrian Rockall on Apr 17, 2015
Latest reply on May 26, 2015 by Adrian Rockall

I know that USB Host is not officially supported by PEx / KSDK yet but here are some notes I have made.


I have added the fsl_usb_framework and configured it as a host. I have also added three class driver settings for USB_SUBCLASS_MASS_UFI, USB_SUBCLASS_MASS_SCSI and USB_SUBCLASS_HUB_NONE. I have then added files to my project from the fatfs\fsl_usb_disk folder, modified the usb_host_config.h and got the fatfs file system working but:


1. Every time I generate the PEx code it removes the USBCFG_HOST_MSC define (should that be USBCFG_HOST_MSD in the usb_core files or should the PEx one be USBCFG_HOST_MSC?) and resets the USBCFG_HOST_HUB back to 0.


2. The default Application callback name given to USBCFG_HOST_HUB is the same as used in the usb_host_hub_sm file so the compiler generates an error. Easily fixed by renaming it to usb_host_hub_event in PEx and calling usb_host_hub_device_event from the generated function in Event.c


3. The USBCFG_HOST_MAX_POWER define seems to be fixed at 250 regardless of the PEx setting.


4. When MQX Standard is added via PEx it appears the pre-emptive multitasking is switched off during initialisation but the msd_disk functions in msd_diskio.c lock up without it. To work around this I have added #else OSA_TaskYield(); to all the loops that watch g_bCallBack so the task that calls command_callback gets some processing time.


Best regards,