This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usbd_hid_get_report_trigger() blocks

I am using a NXP LPC2387 with Keil MDK-ARM Pro 4.6 (and hence RL-USB).

I am using the LPC2387 as a USB HID self-powered device connected to a Win7 PC USB-HOST.

The LPC2387 is enumerating correctly, and passing data using a 1 mSec INTERRUPT transfer initiated by the USB-host.

The problem I have is that usbd_hid_get_report_trigger() is blocking!

I understand that blocking can occur if, and as long as, the last hid report was not sent out. During normal operation I avoid this by only writing to usbd_hid_get_report_trigger() when I know it is empty. I do this by using a s/w flag that is cleared when the endpoint is free.

My problem only occurs when the host is closing down at the same time as report data is loaded into usbd_hid_get_report_trigger(). When the host closes down without any HID data queued, the problem does not occur.

On the next USB-host (PC) boot, (as the device is self-powerd the LPC2387 has not been reset), it appears that usbd_hid_get_report_trigger() may still have a previous hid report queued, because as soon as I give it another report, the function blocks! Yet no HID data is transferred via an Interrupt transfer, even though the host_USB is making HID transfer requests. Transfers on the control endpoint are not affected, only interrupt transfers.

As I cannot control exactly when the USB-host will stop 'polling' for HID data, I cannot avoid this lock-up.

I have tried resetting the USB-stack, but it does not recover the situation. The lock-up still occurs.

The only solution I have found is to hard-reset the LPC2387 after the USB-host (PC) has shut-down.

Anybody have any ideas?

Parents Reply Children