Detecting a USB host with KSDK 2.x on K24

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

Detecting a USB host with KSDK 2.x on K24

508 Views
ryanlush
Contributor IV

I have a bootloader running on a K24 based upon the KSDK virtual comm port example for the Freedom board. Most of the virtual comm stuff has been stripped out and its just 2 bulk endpoints. When the device is powered the bootloader waits 2 seconds to see if there is a USB host and if not it boots the application. Right now I determine I'm in the bootloader when I hit the kUSB_DeviceEventSetConfiguration event in the USB device callback. Basically once enumeration is complete. The trouble is with some computers the device does not enumerate without the driver installed. Then the app starts, complains about low voltage and shuts down. Not really the functionality I'm going for here. I need a way to detect a host without enumeration.

It looks like you get a kUSB_DeviceEventBusReset event when you enable the controller but I never see anymore unless it's plugged into my hub, so I'm also checking to see if I have more than 1 event. This seems to work but I'm making some assumptions about how it works.

Any other ideas are appreciated.

0 Kudos
1 Reply

430 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Ryan:

USB_DeviceEventBusReset is triggered by USB host, I would suggest you do more tests with other hosts.

Regards

Daniel

0 Kudos