AnsweredAssumed Answered

Handling USB errors

Question asked by Phuc Le Dinh on Feb 10, 2017
Latest reply on Feb 10, 2017 by Mark Butcher

Hi NXP team,

 

I'm using a K21 with FSL_USB_Stack from MCUOnEclipse as a CDC device. The K21 is used in a Smart Card reader design.

 

Recently I've run into an interesting EMI-related problem. Whenever the RF field is energised, the USB comms just drops. There is no further comms from the CDC device (it usually sends a heart beat every 30 seconds). I know that the K21 still runs as normal (the field times out) and not stuck.

 

While looking around for answers, I come across this threadHow to recover from USB errors, or how to reinitialize USB0 without a full reset? . I've since commented out 

 

} else if (event_type == USB_APP_ERROR) { /* detach? */

//start_app = FALSE;

//start_transactions = FALSE;

}

and every thing works normally. 

 

I've also done some analysis and noticed that the error happens roughly twice every second. After the USB_ISR is called and an error is read out of USB0_ERRSTAT (e.g. DFN8)USB_ISR is called again after 5us but USB0_ERRSTAT is zero this time. Why is this happening?

 

Re. the above thread, it is recommended to disable the pull up on the data line and let enumeration happens if there is any error. Is it a standard practice to do so? Or are some errors tolerable, thus can be ignored? 

 

Best wishes,

Outcomes