AnsweredAssumed Answered

USB device stack - USB_APP_ERROR event documentation lack?

Question asked by Tsvetan Mudrov on Jun 3, 2014
Latest reply on Jun 12, 2014 by CarlosCasillas

Hello. I can't find any documentation according USB_APP_ERROR event which returns in USB device callback functions. I'm receiving it from time to time and I need to write a code to handle it. But there is no info in manuals according USB errors at all. I have checked the examples in MQX, but all device classes consists just this:

 

else if(event_type == USB_APP_ERROR)

    {

        /* add user code for error handling */

    }

 

OK- I want to add a code to handle the error, but how? I have track the internet for some useful info - but no luck. Seems that most users of MQX just missing this event like its written in examples. But this is an error, it must be handled in some way.

 

Edit: After a tracking in the MQX source codes, I have found that this event consists just the status of the interrupt error registers (flags & enable) ot USB OTG module. So they are returned in val parameter in USB_APP_ERROR event. But later it's really complicate for error decoding, since you need to know in deepest details how the usb device driver and microcontroller implementation are working. Normally MQX should encapsulate the entire USB management and the error handling is a part of this, since most of the users are not familiar with USB operation in deepest details. So it will be good to add error handling in the driver, or at minimum to show how to handle it in examples. A detailed information in user/reference manual is also very important. In fact when I'm trying to search "USB_APP_ERROR" in pdfs, I'm just finding one tag without any useful information.

Outcomes