Hi-
My custom board is a CDC host powered by K20D50M. It has to keep powering/charging external USB CDC device through Vbus all the time but only enumerate it when necessary. Both CDC host and device and based on MQX and K20.
A common practice for starting enumeration is to plug in USB plug to trigger a transition on Vbus, but my case needs to keep Vbus connected consistently.
Question is, is it possible to start the enumeration and USB detachment by only close and open on D+/D- wires by switches?
Thanks!
Hui
Hi
Sorry for the so later reply.
The Kinetis USB module with D+ line with internal pull-up resistor, customer can use register to control D+ line enable or disable pull up.
So, customer can let USB device to disable the D+ pull up with related register setting, then after a while to enable the D+ pull up to simulate a USB device detach and attach action.
Wish it helps
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui
Thanks a lot for your reply!
The enumeration initiative is coming from my USB host. What I understand is USB host has its D+/D- pulled down. I guess it is the transition on D+ (changed by USB device) that actually triggers the enumeration. So, to make question more clear, how to take full control of enumeration on USB host side?
regards
Hui
Hi
Sorry for the so later reply.
When the device disable the D+ line pull-up, the USB host will detect the device be detached. Then the device re-enable D+ line pull-up, the USB host will enumerate the device again. There doesn't do anything on USB host side. The USB host stack should support the device detach/attach operation.
Wish it helps
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui
Thanks for reply!
Now it is clear that the removal of pull-up on D+ will cause detach event on USB Host. A coming back question is, if I add switch on D+/D-, does the open of switch cause USB Device see same detach event as well? In other word, can open/close of USB signal lines cause proper attach/detach event on both Host and Device while Vbus is kept ON all the time?
Have a nice day
Hui
Hi Hui
The USB device doesn't detect the detach happens, while the USB device initiate the remove the D+ line pull up action, so the USB device should know when it was detached. And also the same situation for attach action, the USB device also know when the attach start.
Wish it helps
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Hui
All control of D+/D- is from host side, the device has not idea what has happened. I did a quick test on my self-powered MQX CDC device and received a few times of USB_APP_ERROR event when I manually broke the D+/D-. Problem is, I couldn't receive same USB event again when I repeated the closing and opening D+/D-.
Thanks!
Hui
Hi
It need to remove the pull-up resistor on USB device side, otherwise to remove the D+ line pull-down resistor could not generate USB device detach action.
Wish it helps
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------