Recommend you to use one, https://community.nxp.com/t5/i-MX-Processors/How-use-USB-as-both-gadget-mode-and-host-mode-usb-USB-O...this will do some help for you.