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.
Attached in my init code APIs
Original Attachment has been moved to: usb_code.c.zip