This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB Power events stop after removing the usb cable and plugging it back in 2 - 3 times.

Hey guys,

Ive been trying to add the USB power detection to our device and for some reason I can't get the desired result.

The device is a 52840 using SDK 15.2 and SD ver 6.1.0.

I have enabled the clock and the power modules and have enabled the usb power events in the code.

I passed the callback for the usb events and everything builds no problem, only thing in the callback is just to turn an LED on and off depending if the device is detected or not.

When I use the debugger to see whats going on I would only maybe get 1 detection event and nothing else after.

Without the debugger I would get 2 sets of events (Detected/Removed) and then it would stop.

After that it doesn't matter how many time I plug the USB cable in and out it never generates an event.

A hardware reset is required to resume operation for another 2 sets of events then stops again.

I tried using sd_power_usbregstatus_get(); but I get the same result.

Looking at the VBUS line on the scope I don't see any issues, 5v when plugged in and 0 when removed. 

Any advice would be greatly appreciated.

Thanks,

Ivaylo

Related