Shop OBEX P1 Docs P2 Docs Learn Events
PropellerIDE on MacOS with FTDI and other issues — Parallax Forums

PropellerIDE on MacOS with FTDI and other issues

Tracy AllenTracy Allen Posts: 6,664
edited 2017-04-17 17:14 in Propeller 1
Since upgrading to OS X Sierra 10.12, I've started using PropellerIDE. (Thanks, Brett, Steve, and Parallax!) Initially I had a problem with the FTDI serial ports, including but not limited to the Prop Plug and my own FT231X boards. I hadn't seen this issue mentioned here and it took some hair tearing and googling to figure it out. The issue is that Apple, starting with OS X Mavericks (10.9), has included a driver for FTDI serial ports along with the system install. If you then go and download install the FTDI version 2.3 VCP driver directly from FTDIchip.com, the two will conflict. The symptoms are that you will be able to use the port once, but then if you disconnect the dongle and then come back to it or try to use another one on the same USB port, you will find that it is locked. The only way to get another try is to move to another physical USB port until that gets locks and so on. If you look in the system report under USB, you will probably find that the same VCP serial port is listed twice. To fix this,
delete the FTDI driver. AN134 from FTDI describes how. Delete it using Terminal from /Library/Extensions/FTDIUSBserialDriver.kext. Keep the Apple FTDI driver, which on Sierra is located at /System/Library/Extensions/AppleUSBFTDI.kext. The name and exact location of the Apple driver on pre-Sierra OS versions is different though.

I see that the instructions on the Parallax web site page for PropellerIDE specifically recommend downloading the FTDI version of the driver. That suggestion should probably be stricken or nuanced.

Comments

  • Since upgrading to OS X Sierra 10.12, I've started using PropellerIDE. (Thanks, Brett, Steve, and Parallax!) Initially I had a problem with the FTDI serial ports, including but not limited to the Prop Plug and my own FT231X boards.
    .
    .
    .

    Thank you Tracy! This problem has been haunting me as well in the exact manner you describe.

  • I'll get Jeff to take a look at this thread. He's likely up to date on all aspects of it and will have some input. - Ken Gracey
  • Hi Tracy,

    This is a revisit of a long-time problem that, of course, started back with OSX Mavericks. For a long time we stopped including the FTDI drivers with the installers of certain Mac software because of the problems caused, ultimately, by Apple's supplied driver.

    It sounds like I need to check this very carefully again (though I recall doing so with Sierra even) because Apple's driver for FTDI devices did not include support for DTR control; an important requirement for programing Propeller's and BASIC Stamps.

    In all my testing, I never found there to be a problem on my systems (old and new Mac OSXes) if the FTDI driver was installed, then the system was rebooted; however, based on your experience above, I'm compelled to retest those specific situations again.

    I've also tried directly disabling Apple's "FTDI" driver or FTDI's driver to see the effect.

    Our current releases of SimpleIDE and BlocklyPropClient includes the FTDI drivers, but also required a system restart after install to ensure that Apple's driver takes a "back seat" to the FTDI driver, as Apple intentionally set theirs to a lower priority.

    When I get a chance to do this, I may be calling you to compare notes more in real-time.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-04-18 00:41
    Hi Jeff, Thanks for looking into it; what a mess! It looks like earlier versions of the Apple driver were crippled but have improved with with El Captan and Sierra. The 3rd comment from "armless" in link I posted above quotes FTDI tech support:

    Since 10.9 (Mavericks), OS X has included built-in partial support for some FTDI devices in VCP mode. Starting with 10.11 (El Capitan), Apple's own driver seems to be sufficiently comprehensive that many customers will not need to install FTDI's own VCP unless they wish to use its advanced features such as baud-rate aliasing and configurable latency times.


    Such as... ???

    My own experience is that the Apple driver does work to reset the Prop in Sierra for PropellerIDE once the doubles issue is resolved. I was using bst in El Capitan, 10.11, after a jump direct from 10.6.8, and it was working, but I didn't keep careful track of anything special I did to tweak the system for the FTDI driver. I would say though it was flaky. Yesterday I built Yosemite 10.10 in a separate partition. But that is still not working, as in no DTR response. I tried renaming the Apple driver as .disabled and FTDI 2v3 installed, but that didn't work. I think. I'll take another look.

    I'm puzzled about your observations of a priority in the system's choice of which driver to run. It is strange and I don't fathom the inner workings of the OS. The FTDI driver you download is installed in the user library/extensions, whereas the Apple driver is installed in root library/extensions.


  • jmgjmg Posts: 15,175
    ... because Apple's driver for FTDI devices did not include support for DTR control; an important requirement for programing Propeller's and BASIC Stamps..

    Wow, I'm surprised such a variant is even allowed to exist ?

    How do the SiLabs drivers stack up on MAC OS's ?
    I find these release notes, only broad brush ?
    http://www.silabs.com/documents/public/release-notes/CP210x_ReleaseNotes.txt

  • jmg wrote: »
    Wow, I'm surprised such a variant is even allowed to exist ?
    How do the SiLabs drivers stack up on MAC OS's ?
    I find these release notes, only broad brush ?
    http://www.silabs.com/documents/public/release-notes/CP210x_ReleaseNotes.txt

    It all seemed incredibly ridiculous and infuriating, yes. And we had it independently verified too, so it wasn't just us having the problem.

    I haven't tried the SiLabs drivers.
  • ... The 3rd comment from "armless" in link I posted above quotes FTDI tech support

    <snip>

    My own experience is that the Apple driver does work to reset the Prop in Sierra for PropellerIDE once the doubles issue is resolved. <snip> Yesterday I built Yosemite 10.10 in a separate partition. But that is still not working, as in no DTR response. I tried renaming the Apple driver as .disabled and FTDI 2v3 installed, but that didn't work. I think. I'll take another look.

    Yes, I read that too, today; thanks for including those links! That's a big surprise to me because I recently did a lot of development on Sierra. I will try it again.

    Here's some copied-and-pasted notes I made to myself a while back. It doesn't all apply perfectly here, but check out the kextstat commands and the kextunload / kextload commands... they will help you in your experiments on your side.

    For deep troubleshooting Mac driver issues, here's some notes:
    * Connect the USB-based BASIC Stamp board to the Mac
    * Open a Terminal window
    * Enter:
    kextstat | grep FTDI
    
    * If all is well, it will report a line of information with the driver listed in reverse-domain form (com.FTDI.driver.FTDIUSBSerialDriver).
    * If something's wrong, it won't report anything (try rebooting the Mac)

    Administrator notes for Mac OS X 10.9 (or above):
    * Must install FTDI driver v2.3
    * FYI: This driver's kext gets stored at: /Library/Extensions/FTDIUSBSerialDriver.kext
    * After installation, reboot the system
    * NOTE: You can also enable it from a terminal with:
    sudo kextload -b com.FTDI.driver.FTDIUSBSerialDriver
    
    * Plug in and power the development board and try the
    kextstat | grep FTDI
    
    steps again (above)
    * If the editor software doesn't recognize the BASIC Stamp, you may need to disable the Apple-supplied driver with the following via a terminal:
    sudo kextunload -b com.apple.driver.AppleUSBFTDI
    
    * And enable the FTDI driver with:
    sudo kextload -b com.FTDI.driver.FTDIUSBSerialDriver
    
    * Try the
    kextstat | grep FTDI
    
    steps again (above) to verify

    Administrator notes for Mac OS X 10.8 (or below):
    * Must install FTDI driver v2.2.18
    * FYI: This driver's kext gets stored at: /System/Library/Extensions/FTDIUSBSerialDriver.kext
    * After installation, reboot the system
    * NOTE: You can also enable it from a terminal with:
    sudo kextload -b com.FTDI.driver.FTDIUSBSerialDriver
    
    * Plug in and power the development board and try the
    kextstat | grep FTDI
    
    steps again (above)
    I'm puzzled about your observations of a priority in the system's choice of which driver to run. It is strange and I don't fathom the inner workings of the OS. The FTDI driver you download is installed in the user library/extensions, whereas the Apple driver is installed in root library/extensions.

    I observed it, yes, but only after trying to do so after noting it in Apple's initial documentation... which may have since changed. Ironically, when I learned of all this, I happened to have the ear of a very great, former Apple employee who sat with me and helped me a tremendous amount, or I'd probably still be somewhat clueless about it! Unfortunately, now it sounds like that's not the case (in Sierra+) and we'll have to do something else again.



  • I now see the symptoms you mentioned, where things work fine until you unplug the board, then plug back in.

    However, if I disable the FTDI driver and let the Apple driver take over, I can't download to the Propeller. I seem to be able to reset the Propeller through proploader, but every download attempt fails.

    You're probably using propeller-load. Can you confirm?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-04-20 00:51
    Hi Jeff,
    I've emailed FTDI field engineering. My most recent question was for clarification of the statement "unless.." in their app note AN_134,

    Since 10.9 (Mavericks), OS X has included built-in partial support for some FTDI devices in VCP mode. Starting with 10.11 (El Capitan), Apple's own driver seems to be sufficiently comprehensive that many customers will not need to install FTDI's own VCP unless they wish to use its advanced features such as baud-rate aliasing and configurable latency times.


    AN_107_AdvancedDriverOptions

    In particular, I was concerned about the handshaking and CBUS lines, and the battery charge control features. The response was,
    In your battery charger application, I recommend using the FTDI v2.3 VCP driver. Keep in mind FTDI has control of this driver.
    It would make for an interesting lab experiment to see if both drivers support HW handshaking and all CBUS options.
    You can determine which driver is currently enabled on your Mac by using the kextstat –a | grep FTDI command. (the kextstat, kextload and kextunload commands could be made into useful AppleScripts for non tech users)


    So again it looks safest to rely on the FTDI driver for all OS X versions. Users of Mavericks and up would have to be instructed how to dump the Apple driver for good. The idea of kextunload/kextload via an Applescript after each restart is not appealing. I didn't learn anything about a "priority" of drivers. Still in "lab experiment" mode here too.

    I'm not sure if I know what you mean by "propeller-load". I'm running PropellerIDE v 0.33.3 on 10.12.3, with openSpin as the compiler. It resets and downloads fine. The serial terminal app within PropellerIDE is okay, but I often switch over to CoolTerm instead. Reset works fine there too. PropellerIDE is detecting and handling multiple USB serial ports well, no lockups after unplugging or switching ports. And, that is using the Apple driver, I dumped the FTDI driver (but may reverse that)
    THOMASs-Air:~ thomasallen$ kextstat -a | grep FTDI
    195 0 0xffffff7f832b5000 0x6000 0x6000 x86_64 com.apple.driver.AppleUSBFTDI (5.0.0) DA746E19-3830-34FA-A6E8-5F9AF66B7419 <101 19 5 4 3 1>

    About the BASIC Stamp. I haven't tried Murat's MacBS2 version 3 on Sierra yet, but I have a report from someone that it does work, but with the limitation of only one slot.


  • Heater.Heater. Posts: 21,230
    Good grief. All this fuss over a simple UART interface.

    I don't know if its the FTDI guys or a USB thing.

    Serial interfaces have been with us since the dawn of computing. And still they are a hassle!

    How is this even possible?


  • Good grief, yes. Or the Apple guys. The Mac is supposed to be easy since the dawn of time.
  • Never did we have such surprising and changing problems with RS-232 ports; there were problems, sure, but they were stable and well ironed out well before USB came along. It's a darned shame stuff like this makes customers struggle and companies scream.
  • Heater.Heater. Posts: 21,230
    Back in the early 1980's a couple of us green horn engineers were trying to get a DEC VAX to talk to some control system over a serial link. After a couple of days messing with hand shakes and protocol etc the boss dropped by.

    "Ah" he said, "I always takes at least two days to connect anything to anything"

    He was a wise old boss who had been round that block a few times.

    Judging from the questions on forums like this, after thirty years my old boss is still right! His statement has been ringing in my head a couple of times every year since then.




  • When I was working on chips that went into smartphones, it seemed like the serial link (4-wire UART or I2C) was one of the harder things to get working for the customers. Often they were using a reference design done by the cellular baseband provider, and had no idea how anything really worked.
  • Mike GreenMike Green Posts: 23,101
    edited 2017-04-22 03:53
    I'm trying to use PropellerIDE to load Tachyon V4 and am having load failures. I'm using Apple's FTDI driver and it seems to work with small programs, but not large ones like Tachyon's almost 32K. I have a recent MacBook Pro running MacOS 10.12.5. Next week (when I have the time) I plan to try FTDI's driver disabling Apple's driver as described earlier in this thread. Any other suggestions? I have a Linux netbook that I can use to load Tachyon V4 with PropellerIDE. The load fails maybe 1 out of 3 attempts, but that's good enough for my needs. I would rather use the Mac though.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2017-04-24 17:03
    At the moment I have the Apple driver disabled by changing the extension from .kext to .disabled, and FTDI 2.3 loaded instead.

    In Sierra, the /system directory is protected by the new System Integrity Protection, and you have turn that off in order to .disable the Apple driver.
    Disable SIP by booting into recovery mode, (command-R), and in terminal enter,
    csrutil disable
    Then reboot. Then from terminal sort of follow the instructions in section 7 of the FTDI AN-134
    cd /system/library/extensions
    sudo mv AppleUSBFTDI.kext AppleUSBFTDI.disabled
    sudo touch /System/Library/Extensions.
    SIP can be reenabled in recovery mode with, csrutil enable.

    Mike, regardless of whether it is the Apple driver or the FTDI 2.3 driver on Sierra 10.12.3, on a MacBook Air (2015) I continue to see sporadic load failures with PropellerIDE. It usually times out instantly after hitting the Run or Load buttons. I have to say sporadic, because sometimes it works, sometimes not. Often it works after several tries in succession and then goes through to completion. I haven't tested your observation about longer programs. I'm interested to hear about your followup.

    The serial ports using either driver show up fine in all other respects, in the PropellerIDE pulldown menu, in the System information screen for USB, and in kextstat reports from terminal. It's just erratic to load the Prop. I'll look again at DTR to see if the reset is coming through with PropellerIDE. I think it's not that. When I've tested DTR using CoolTerm, it reliably toggles DTR with either driver.
  • Wow what a mess.

    Here is my system after the USB lockup i.e. unplug and plug in a propplug.

    dp-2:Contents dp$ sudo kextunload -b com.FTDI.driver.FTDIUSBSerialDriver
    (kernel) Can't unload kext com.FTDI.driver.FTDIUSBSerialDriver; classes have instances:
    (kernel)     Kext com.FTDI.driver.FTDIUSBSerialDriver class FTDIUSBSerialDriver has 2 instances.
    Failed to unload com.FTDI.driver.FTDIUSBSerialDriver - (libkern/kext) kext is in use or retained (cannot unload).
    dp-2:Contents dp$ uname -a
    Darwin dp-2.local 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64
    
  • Still can't get PropellerIDE to download to Propeller. Currently using High Sierra beta either with Apple default driver or latest FTDI driver. Serial port shows up and download proceeds for a second or so, then fails. Same problem with earlier MacOS versions (like Sierra). SimpleIDE seems to work.
  • Thank you!

    This was happening to me on MacOS X 10.14.6

Sign In or Register to comment.