Hi NXP team,
When we are changing the role of the imx8 from host to gadget we are losing the connection which could be expected but its not reattaching (enumerating) the connected mobile device
In case of CarPlay we are changing the role of the imx8 from host to gadget and sending role switch custom command to Apple phone to reverse its role as Host but we could observe its disconnected. Possible cause of disconnection occurs because of NACK. Apart from this, supplying the power from imx8 to the Apple phones irrespective of the role is also something we are facing issue with -
Kindly help on this issue. Also, provide role switch working binary if it is available for imx8qxp/qm mek.
Thanks a lot in advance.
I have added the below details with respective to usb roleswitch application which we have tested.
Steps followed in Roleswitch test:
1. Keep iPhone connected
2. Send roleswitch command to iphone
3. Do HU roleswitch
4. Verify iPodout0 node is created
5. Disconnect and verify switch back to host mode
1) Keep iPhone connected
Initialized the required values for iPhone roleswitch:
vendor = strtoul("0x05ac", NULL, 16);
product = strtoul("0x12a8", NULL, 16);
bmRequestType = strtoul("0x40", NULL, 16) & 0xFF;
bRequest = strtoul("0x51", NULL, 16) & 0xFF;
wValue = strtoul("0x01", NULL, 16) & 0xFFFF;
To check whether iphone got connected based upon vendor and product id:
hdev = libusb_open_device_with_vid_pid(NULL, vendor, product);
2) Send roleswitch command to iphone
API called to send roleswitch command to iphone:
libusb_control_transfer(hdev, bmRequestType, bRequest, wValue,0, 0, 0, DEFAULT_TIMEOUT)
Command sent:
40 51 01 00 00 00
3) Do HU roleswitch
To change the role of imx8dx(chip idea USB) to gadget:
system ("echo gadget > /sys/bus/platform/devices/ci_hdrc.0/role");
4) Verify iPodout0 node is created
Condtion to check ipodout node got created or not:
if(access("/sys/class/ipodout", F_OK) != -1) {
5) Disconnect and verify switch back to host mode
To change the role of imx8dx(chip idea USB) to host:
system ("echo host > /sys/bus/platform/devices/ci_hdrc.0/role");
Note: Attached the usb analyzer log captured during roleswitch operation.