AnsweredAssumed Answered

iAP2 USB support with iMX6 Nitrogen

Question asked by sebastianvogel on Feb 11, 2015
Latest reply on Aug 6, 2015 by Dennis Bruggner

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?

Outcomes