2012-11-04 10:45 PM
Hi, I have been using the the MSD class driver for usb host on an STM32f4 board. The host seems to work fine for some time, but after say 200 read/write ops it gets stuck at:
void
USBH_Process(..................)
......
case
HOST_CLASS:
/* process class state machine */
status = phost->class_cb->Machine(pdev, phost);
.......
static
USBH_Status USBH_MSC_Handle(...........)
case
USBH_MSC_BOT_USB_TRANSFERS: <- stuck here
/* Process the BOT state machine */
USBH_MSC_HandleBOTXfer(pdev , phost);
..........
void
USBH_MSC_HandleBOTXfer (.................)
switch
(USBH_MSC_BOTXferParam.BOTState)
{
....
case
USBH_MSC_BOT_DATAIN_STATE: <-stuck here
I tried a few ways to manually rest this state but i was unable to figure out how, it would either keep on enumerating or something like that. How do I reset the state so it isnt stuck here? I can remove and put on power to the usb host port but I would keep that as a last resort.
#stm32 #usb #library #host #msc
2012-11-05 04:14 AM
Issue resolved, i was using both USB FS(as MSC host), and USB HS device. I changed USB_FS_IRQ priority to highest among usb hs/fs priorities and this fixed the issue. Don't know why that was causing the problem.
2014-08-06 12:04 PM
I would like to thandk you stavish.
I was having the same issue (the program was getting stuck in the while condition ''while(status == USBH_MSC_BUSY )'' on the disk_write function) , in my case the USB host interrupt was facing concurrency with one of the higher priority interrupts of my program. To solve the problem, I changed the USB Host Interrupt to the highest priority.