fsl_usb_framework host file system

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fsl_usb_framework host file system

885 Views
adyr
Contributor V

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,

Adrian.

3 Replies

482 Views
jiri_rezler
NXP Employee
NXP Employee

Hello Adrian,

please find my comments below:

ad 1.  In Processor Expert KSDK1.2.0 version have been added USBCFG_HOST_xxxx (+ USBCFG_DEVICE_xxxx) properties to 'fsl_usb_framework' component, which allow USB HOST stack configuration.

ad 3. I can not reproduced this issue. Value of  USBCFG_HOST_MAX_POWER symbol is specified by "Max. power support in mA" property (USBCFG_HOST_MAX_POWER = "Max. power support in mA" property value /  2).

Value of the USBCFG_HOST_MAX_POWER symbol is compared with "bMaxPower" (Max.power from bus 2mA units, value in configuration descriptor returned by USB device).

Best regards,

Jiri Rezler.

482 Views
adyr
Contributor V

KDS 3.0 + KSDK 1.2 has made it easier to add the FatFS and no longer fights against the required settings which fixes my original question 1 so thank you for that.

As far as I can see, Time Slice is still not enabled but the new implementation does somehow allow the loops in msd_diskio.c to yield to the KHCI Task (which sets the flag that terminates the loops) so that is all good now and fixes my original question 4.

Thanks to Jiri and the freescale team.

Best regards,

Adrian.

0 Kudos

482 Views
adyr
Contributor V

Thank you for the reply Jiri.

ad 1. Do you know if support for adding a file systems to the USB has been added to then next version?

ad 3. I hadn't realised there was a divide by 2 and when I changed it in PEx I must have forgotten to re-generate the code as it is working as you state.

ad 4. Do you know if there is there going to be an option to add a time slice period to the OS_Task components and an option for setting the MQX_HAS_TIME_SLICE to 1?

I tried adding the #define MQX_HAS_TIME_SLICE 1 to the User Settings - Definitions section of the MQX_KSDK component but the contents get written to the mqx_sdl_config.h after the #include "small_ram_config.h" line so it just generates compiler errors due to being redefined.

I'm looking forward to 1.2 coming out as it sounds like it will address a few issues I'm having.

Best regards,
Adrian.

0 Kudos