PropellerIDE on MacOS with FTDI and other issues
Tracy Allen
Posts: 6,664
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.
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
Thank you Tracy! This problem has been haunting me as well in the exact manner you describe.
https://forum.arduino.cc/index.php?topic=427825.0 . <-- 3rd comment quotes email from FTDI tech support
https://superuser.com/questions/1135730/how-to-release-reset-serial-port-ftdi-devices-mac-osx
https://discussions.apple.com/message/31195311#message31195311
https://developer.apple.com/library/content/technotes/tn2315/_index.html
http://www.mommosoft.com/blog/2014/10/24/ftdi-chip-and-os-x-10-10/
http://www.ftdichip.com/Support/Documents/AppNotes/AN_134_FTDI_Drivers_Installation_Guide_for_MAC_OSX.pdf
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.
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.
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.
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:
Administrator notes for Mac OS X 10.9 (or above):
Administrator notes for Mac OS X 10.8 (or below):
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.
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?
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.
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?
"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.
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.
Here is my system after the USB lockup i.e. unplug and plug in a propplug.
Thank you!
This was happening to me on MacOS X 10.14.6