Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: iOS / usb woes

  1. #1
    Senior Member
    Join Date
    Feb 2013
    Posts
    532

    iOS / usb woes

    hi,

    here's a question/issue, which, I suppose, is about iOS rather than teensy: i'm having trouble to get two of my projects recognized as a usb device on an ipad (ipad pro 2017, iOS 12.0, apple camera connection kit). both work fine with a regular/proper computer (macbook pro).

    the one is a custom MK20/audio device, the other a midi device with a regular teensy 3.2 attached. being eurorack modules, they're both powered by their own +12V/-12V PSUs, so i didn't connect V_USB, just gnd, d+, and d- ... which seems to be the problem. at least, there seems to be no problem getting a teensy 3.2 (or 3.6) registered as a midi/audio usb-device as long as it receives 5V on the V_USB bus, from the ipad.

    what's weird is that the modules _used_ to work with iOS, despite the missing V_USB (that is, with previous versions of iOS). so i guess my question is: is it possible that the iOS developers changed the requirements in this regard?

    thanks in advance (in case anyone had any insights ...)

  2. #2
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,896
    Yes, IOS 12 introduced some new security functions for peripherals. The user has to allow the connection. But obviously, when no current is drawn or sourced, the IOS device does not ask the question. I would add a 150R resistor to the V_USB line towards ground, so that 30mA will be drawn and check if the iDevice will now ask for authorisation of the peripheral.

  3. #3
    Senior Member
    Join Date
    Feb 2013
    Posts
    532
    i see, so something did change ... thanks.

    ... i've never given much thought to finer details of USB detection (or rather, simply been following this: https://www.pjrc.com/teensy/external_power.html ), but poking around a bit, wouldn't/shouldn't this be sufficient to make the host (or ipad) detect a/the device? https://github.com/PaulStoffregen/co...sb_dev.c#L1166

  4. #4
    Senior Member
    Join Date
    Feb 2013
    Posts
    532
    ... ok, sorry for the false alarm: the midi device started working again after giving it (it seems) a different product name, ie despite the absence of V_USB. same for an old wm8731 break-out board i had lying around (*). so nothing related to iOS 12 or V_USB.

    the above-mentioned audio device still isn't working, but that seems to be due to me having used a USB isolator (ADuM3160), the presence of which the iPad doesn't seem to like. not sure why that is ... it works just fine with my macbook pro and i wouldn't know how else to wire the ADuM3160. well, i guess i'll just have to live with not being able to use an iPad (or without the ADuM3160).

    anyways, ... the whole episode made me wonder though how one would actually go about turning a/the teensy into a proper "self-powered" USB device? just cutting the V_USB trace doesn't seem to be entirely right, but then i'm not sure what's going on under the hood or whether i fully understand the USB specs in this regard:

    "No device shall supply (source) current on VBUS at its upstream facing port at any time. From VBUS on its upstream facing port, a device may only draw (sink) current. They may not provide power to the pull-up resistor on D+/D- unless VBUS is present (see Section 7.1.5). When VBUS is removed, the device must remove power from the D+/D- pull-up resistor within 10 seconds"
    ... but once the trace is cut, there's no way of telling the V_BUS is present or not. i guess i could use a spare GPIO pin to "sense" it, but then what?

    (*) on a side note, the MACOSX_ADAPTIVE_LIMIT fix doesn't seem to work for iOS/ipad (?); at least, when giving the wm8731 a quick test run (using teensy = master), the audio distorted horribly after a few seconds, while the same device/code works ok on High Sierra.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •