USB Enumerate and Disconnect loop

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

USB Enumerate and Disconnect loop

815 Views
mattasmith
Contributor I

I have inherited a project which uses the USB interface on a Kinetis (MK22FN1M0VLH12) to pass sensor data to a host PC or thin client.  The problem I am having is that the device enumerates and appears in the device manager on a Windows PC, but then after a short time disconnects and then re-enumerates.  This repeats in an infinite loop.  I'm looking for some guidance as to where I should be looking in the configuration that could cause such an issue.  kinetis mk22 usb design 

Tags (2)
0 Kudos
Reply
1 Reply

660 Views
mjbcswitzerland
Specialist V

Hi Matthew

It sounds as though your board is resetting (which will cause this behavior). If it is not resetting (eg. watchdog reset) it could be that the USB device is failing (eg. stalling or has a class-error) whereby the USB host will eventually give up and command a reset of the USB interface (this can often take 20..40s).

Therefore check for watchdog reset cycle or set a break point the USB reset detection routine to identify which tyep of problem it is. If you have a USB analyser you will be able to see USB (low-level or class) issues (you can also try Wireshark with its USBPcap plug-in if you are a hobbyist or your project don't have funding for development tools).

You can also use the OpenSource uTasker project which has bullet-proof USB device operation in case it proves to be due to your library rather than application level problems.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html
Kinetis K22:
- http://www.utasker.com/kinetis/FRDM-K22F.html
- http://www.utasker.com/kinetis/TWR-K22F120M.html
- http://www.utasker.com/kinetis/BLAZE_K22.html
- http://www.utasker.com/kinetis/tinyK22.html
Networking: http://www.utasker.com/docs/uTasker/uTaskerNetworking.pdf

Builds with: CW10.x, KDS, MCUXpresso, IAR, Keil, Greenhills, Crossworks, CooCox, Atollic, S32 Design Studio, GNU Make and Visual Studio


Free Open Source solution: https://github.com/uTasker/uTasker-Kinetis
Working project in 15 minutes video: https://youtu.be/K8ScSgpgQ6M

For better, faster, cheaper product developments consider the uTasker developer's version, professional Kinetis support, one-on-one training and complete fast-track project solutions to set you apart from the herd : http://www.utasker.com/support.html

0 Kudos
Reply