Hi all,
I am trying to use USB host and device configuration dynamically on k21 system. I am polling on a USB ID pin and configure host or device based on ID pin detection.
But I need this dynamically happen, so when system is running if I should able to change configuration from device to host or vise-versa.
Currently I can configure system either to host or to device once at time of boot sensing ID pin. But when I change ID pin while system is running then it does not reconfigure and fails for any data communication.
Any suggestions?
Attached in my init code APIs
Thanks,
Rahul
Original Attachment has been moved to: usb_code.c.zip
Hi Rahul,
I'd like to highly recommend that you should choose USB On-The-Go mode which can determine the role of the device based on hardware signal,
and then initializes the device in the appropriate mode of operation (host or peripheral) based on how it is connected.
The KSDK 1.2 also contains the USB On-The-Go demo for K21 and please go ahead to download through the link as below.
Software Development Kit for Kinetis MCUs|Freescale
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------