USB FS Host , MSC class not starting under FreeRTOS..
Hi,
Hoping for some pointers on using the CubeMX generated middleware correctly (Im using NucleoF767ZI in this case). I’ve been trying to get the USB host with FatFS running under FreeRTOS and struggled.
Once debug was enabled I can see this much progress ;
USB Device Attached
PID: 751h
VID: 5e3h
Address (#1) assigned.
Manufacturer : USB Storage
Product : USB Storage
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
And it progresses no further. I can see that in usb_host.c , USBH_UserProcess() is called a couple of times but it does not reach the HOST_USER_CLASS_ACTIVE: state , which should be the triggger that I can try mount the drive etc.
So looks like the MSC class did not start up correclty. After some fiddling around I created a more basic project with or without FreeRTOS generated by CubeMX.
With the no RTOS project , the debug looks better, the MSC class is working this way ......
Main() started
USB Device Attached
PID: 751h
VID: 5e3h
Address (#1) assigned.
Manufacturer : USB Storage
Product : USB Storage
Serial Number : N/A
Enumeration done.
This device has only 1 configuration.
Default configuration set.
Switching to Interface (#0)
Class : 8h
SubClass : 6h
Protocol : 50h
MSC class started.
Number of supported LUN: 1
LUN #0:
Inquiry Vendor : Generic
Inquiry Product : STORAGE DEVICE
Inquiry Version : 1402
MSC Device ready
MSC Device capacity : 1990196736 Bytes
Block number : 3887103
Block Size : 512
It pretty much does that out of the box, from a generated cubeMX project including USB FS host, MSC class and FatFS (no FreeRTOS). The only thing to add was enabling printf() output , and flip the direction of the USB power control pin (cubeMX ouput for Nucleo F767ZI with FW1.40 does SET GPIOG 6 when it should be RESET and vice versa)
I have to be missing something here, the FreeRTOS project looks also like its set up ready to go and starts that way but stalls.
Maybe someone bumped into the same issue before, has an idea what could be causing it or how to debug further? I tried looking in the MSC class (usbh_msc.c) and saw a function looking like it should be being called USBH_MSC_Process() , but its never fired.
any thoughts appreciated!
thanks,
vik