AnsweredAssumed Answered

How to set a new project for host USB mass storage

Question asked by João Ribeiro on Apr 8, 2020
Latest reply on Apr 20, 2020 by Diego Charles

Hello,

 

We are trying to create a new USB host pen driver reader/writer project in the new version of the MCUxpresso on a bare metal board, but we are struggling to set it up correctly. Here is what we are doing.

 

First of all we have already tested the twrk64f120m_host_msd_fatfs_bm example provided by the sdk and it all went perfect, but now we want to create a new and clean project using the functions that the new IDE provides. Therefore we started like this:

1st. Create the new project for the correct uC

2nd. import the correct drivers and middleware

3rd. Set up the correct pins for the USB and enable the USB FS clock on the clock tab

4th. Get the mass storage config on the Peripherals tab. We can only set it as a generic HID

 

It does compile correctly and after placing the USB_HostTasks(); on my while(1), I always get the message "Device not supported" 

 

With some breakpoints I figured that the firmware is aware when we plug a new USB pen drive to the board, but on the function USB_HostInterface0HidGenericEvent it will not get through the if ((pid == 0x00a2) && (vid == 0x1fc9)).

 

I am probably wrong but I think that the Peripherals tab hasn't got the proper setting for the mass storage usb, therefore it does not set the USB_HOST_CONFIG_MSD and this type of devices will not get discovered. Is this correct? Am I setting the project correctly?

 

Thank you for the help

Regards

Outcomes