USB role switch with chipidea on i.MX8QXP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB role switch with chipidea on i.MX8QXP

ソリューションへジャンプ
3,489件の閲覧回数
afridi20
Contributor III
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.
          
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
3,251件の閲覧回数
afridi20
Contributor III
Role switch is happening using the carplay application and driver.

元の投稿で解決策を見る

0 件の賞賛
返信
9 返答(返信)
3,448件の閲覧回数
Rita_Wang
NXP TechSupport
NXP TechSupport

Could you tell us which version of BSP are you using?  We will help confirm.

0 件の賞賛
返信
3,446件の閲覧回数
afridi20
Contributor III

Android Q10.0.0_2.6.0 (Linux 5.4.70 kernel)

0 件の賞賛
返信
3,435件の閲覧回数
Rita_Wang
NXP TechSupport
NXP TechSupport

MX8 and i.MX6 using same usb2.0 chipidea controller IP. As far as i know, chipidea usb 2.0 controller used by many i.MX6 customer's carplay product. In this case, by checking role_switch_workinglog-, chipidea controller role switch no problem. But issue likely related their test application or their carplay related kernel driver(such as iap). If customer could prove issue related to i.MX8 usb2.0 controller , i can only support on usb2.0 controller kernel driver debug. But if issue related to their carplay application or carplay related driver, such support need access Apple confidential spec and code, I suggest customer using professional services. This is update from our expert team. Hope can do help for you

0 件の賞賛
返信
3,439件の閲覧回数
Rita_Wang
NXP TechSupport
NXP TechSupport

Note: Attached the usb analyzer log captured during roleswitch operation.

We do not see your attached files.

0 件の賞賛
返信
3,296件の閲覧回数
afridi20
Contributor III

Hi @Rita_Wang , Do we need to pull up the D+ line for role switch to work properly? Explain the reason for D+ pull up if it is required?

0 件の賞賛
返信
3,308件の閲覧回数
afridi20
Contributor III

Hi @Rita_Wang , Not able to attach the log file. Attached it screenshot. Please check it.

0 件の賞賛
返信
3,309件の閲覧回数
afridi20
Contributor III

Screenshot from 2022-02-28 20-01-59(1)(1).pngScreenshot from 2022-02-28 20-02-23(1).png

0 件の賞賛
返信
3,252件の閲覧回数
afridi20
Contributor III
Role switch is happening using the carplay application and driver.
0 件の賞賛
返信
2,428件の閲覧回数
Dmitriy_Nikitin
Contributor I

Hi, could u be more detailed in your answer? Need to change linux drivers?

0 件の賞賛
返信