iAP2 USB support with iMX6 Nitrogen

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iAP2 USB support with iMX6 Nitrogen

8,202 Views
sebastianvogel
Contributor I

Hello,

I am planning to implement iAP2 support on my iMX6 Nitrogen board, running a Linux 3.0.35. Currently I am struggling with the fact, that the iPhone does not initiate a USB enumeration, and I hope I can get some help here.

What do I currently have:

  • iAP2 is in my cased based on the USB layer, including a USB role switch. Thus I connect the iPhone to the USB OTG port of the board, and send the phone an Apple-specific USB command, which is supposed to trigger a role switch on USB side. This works, as the iPhone resets its USB port (as specified in the iAP2 specification). Note that the iAP2 specification use this custom USB command, not the HNP protocol.
  • Immediately after, I insert a self-written USB Gadget based driver, which is supposed to announce 1 USB configuration, containing 3 USB identities (iAP2 and 2x NCM). I use the arcotg_udc of Linux (I think it is the Freescale provided USB gadget driver) as the USB device controller.
  • While this works, when I put a PC on the other end of the cable (the USB configuration gets retrieved, NCM gets automatically connected, and even TCP communication is working out-of-the-box), this is not the case with the iPhone. From what I can see from journalctl, the phone does the USB reset, but there is no further action from phone side.
  • I own a USB sniffer, which is supposed to support USB OTG, but it does not see any action from the phone. On the other side, when I connect it to my PC, the role switch works and I can see the USB enumeration and NCM packages.

Of course there are hundreds of possible reasons, and I am trying hard to eliminate one after the other. But for some information I would need a little help:

  1. Has anybody ever done this before? Is there any customer that ever did this? (if so, I am on my track and can continue)
  2. Or is it a well known impossibility? (if so, I can stop immediately)
  3. The iAP2 specification mandates the following about the USB D+ pin: "The accessory [that is me] must detect the bus disconnect and turn on the D+ pull-up. See On-The-Go Supplement, Revision 2.0, version 1.1a, Section 5.2.1, Step C. The Apple device will assert a bus reset signal to start using the bus [I think this is not happening]. See On-The-Go Supplement, Revision 2.0, version 1.1a, Section 5.2.1, Step D". From what I can see in the arcotg_udc driver sources, there is a possibility to turn on the D+ pull-up (but only under certain conditions). Is this the way to go, or does it collide with the Linux USB driver infrastructure workflow? (I can see some log messages about suspend and resume, which might cause the pin to turn up on and off)

Currently, I can only imagine that this D+ pin is causing the trouble, since everything else is done as specified. Of course, it can always be a broken phone as well, but I doubt this is the case.

Do you have any information?

Labels (3)
5 Replies

1,483 Views
wangyilong
Contributor III

Mark. I'm doing the same thing today:)

0 Kudos

3,115 Views
dennisbruggner
Contributor I

Hello,

I'm trying the same with an i.mx 6SoloX Board. I have done the same procedure as you.

As mentioned here:  https://www.kernel.org/doc/Documentation/usb/chipidea.txt  you can do a roleswitch between two devices from userspace. I have compiled the necessary module into the kernel, but no luck. I see the given files, but when I write to them, nothing changes, no role switch.

In the driver source: Linux/drivers/usb/chipidea/otg.c - Linux Cross Reference - Free Electrons there is a function which does roleswitch depending on the id pin. Perhaps it's possible to turn this off, to make a manual roleswitch?

Regards,

Dennis

0 Kudos

3,115 Views
mohammadzahabsh
Contributor I

Hi Sebastian,

Could u get the solution to your issue.

I am facing the similar issue. Any input would be of great help.

Regards

Zahab

0 Kudos

3,115 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sebastian

seems some info regarding apple devices one can look at

(USB Role Switch\i.MX6Q\ReleaseNotes.pdf)

USB Role Switch.zip

How to enable OTG2 to USB device mode in i.MX6 solo lite CPU ? | Freescale Community

Best regards

igor

3,115 Views
XiaoPong
NXP Employee
NXP Employee

All,

     Update the link below:

     How to enable OTG2 to USB device mode in i.MX6 solo lite CPU ?

Best Regards,

Wilson

0 Kudos