USB device stack - USB_APP_ERROR event documentation lack?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

USB device stack - USB_APP_ERROR event documentation lack?

532 Views
tsvetanmudrov
Contributor III

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.

Labels (1)
Tags (4)
0 Kudos
1 Reply

346 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Mudrov,

Each bit of the USB status and flags register indicates the kind of error that happened. Based on that, you could use the already included functions for error recovering.

Hope this will be useful for you.

Best regards!

/Carlos

0 Kudos