TeensyDuino conflict with Adafruit board libraries?

David84

New member
Hy,

I work with Teensy 3.5 (and also sometime 3.2) on TeensyDuino 1.5.6 since years without any problem. Great board, thanks a lot for this product (I like the 5V tolerant that simplify schematics, too bad it's gone... but show must go on;))!!

Last week, I wanted to try ItsyBisty M4 Express from Adafruit, and installed the SAMD librairies from Adafruit on Arduino IDE 1.8.13 (I expected it won't destroy anything on TeensyDuino, but it did).
From that moment, I've problem with IDE losing port both with TeensyDuino or Adruino IDE, both with ItsyBitsy M4 or Teensy 3.5...

The most important for me is to work with my Teensy3.5 that support a lot of projects. So I uninstall the Adafruit librairies from TeensyDuino. But the problem is still there!!

I start in this configuration below, with the port selected, and a small blink sketch with a Serial (9600 bauds) that post "OK" every 500ms, serial monitor window opened.
Capture_port.jpg
→ sketch uploaded without problem, port always in list, serial monitor works fine. It blinks.
note: I'm not sure, but in my memory, the "tools" tab doesn't show so much options... something change in TeensyDuino after the Adadfruit librairies installation. And doesn't come back with uninstall.

I can modify and upload the sketch 2, 3 or 5 times. But at one time, I get an upload error and lose the port and get this:
Capture_noport.jpg
And in the serial monitor window, nothing more happens.
What is strange: if I try to upload again without changing anything (and no push Program button) I can upload the sketch and it works... or not... seems that there is no relation between the upload error and the port change.
After a while, 30s or more, the port reappears. But this is not a guarantee of uploading... again, I don't see the relation between my capability to upload and the port displayed in the tool list.
I can upload 5 times, and then have the bug 6 times... big sketch, small sketch... I didn't identify what determines the problem.

Another scenario is: the port is in list, I upload, get an error, press the Program button and nothing happens... after 20s or 30s the sketch upload (without me doing anything), but the port is still in second case. In this scenario, serial monitor doesn't works. After a while 30s or 1mn the serial monitor write again and I can see again the port in list.
The only thing I'm sure, is that when the port display show the second case, the serial monitor doesn't work (difficult to reproduce the bug, I'm not sure sure).

One or twice I get an "HID" port (I remind you that in any case, I never touch the tools->port, only the "upload" button, and the "tools" in menu bar to show the port list, nothing else).
Capture_HID.png

My wish is to continue to work on my Teensy 3.5... I hopped that re-install TeensyDuino will work, but all my attempts have failed, because there is still something in the librairies... and a new installation get the bad piece of librairies from the other versions of Arduino IDE... Is there a way to erase all installation and re-install TeensyDuino to re-start again with a "blank page"? In which system folder (OSX 10.14.4) Arduino IDE store the modifications?... to erase it?
note: I ask Adafruit here:
https://forums.adafruit.com/viewtopic.php?t=201360
... and wait a solution to be able to work again...
Thanks a lot!
 
limited suggestions given it isn't English and not Windows ... the screenshots do show IDE 1.8.19 in use

On Windows downloading the IDE 1.8.## as a ZIP allows unzipping and using from a unique directory. It will share the 'sketchbook folder' and the 'libraries' there - but would allow TeensyDuino install into that unique version if that is the problem where the Adafruit install version causes the conflict.

The USB ports can get confused and sometimes a restart is needed?

TyCommander can be used for Teensy Serial Monitor and uploading as well. It doesn't seem to lose ports ... again that is based on Windows. It runs on the other OS's
 
Thanks for helping :)

On OSX when I open TeensyDuino 1.5.6 it shows a window with the title "Arduino IDE 1.8.19" and for another example, TeensyDuino 1.5.3 shows a window titled "Arduino IDE 1.8.13".
I have 2 versions of TeensyDuino and 3 versions of Arduino IDE installed. I can verify that if I install a board library with the board manager (not libraries for sketch), it will be installed for all the versions. Same for uninstall.
It means that there is somewhere a folder that keep this changement for all versions... but I cannot identify where... I hope that if I find it, it will be possible to delete it, and reinstall the program without taking in account the previous bad changes...

I don't know how to verify if there is USB port conflict... but I know that the problem start just after I install Adafruit Board Librairies for ItsyBitsy M4. I didn't anything else on the system... When I restart computer, the problem is still there.
 
It means that there is somewhere a folder that keep this changement for all versions... but I cannot identify where... I hope that if I find it,

Look for the Library/Arduino15 folder in your home directory. It's probably hidden by Finder (and I'm not familiar enough with MacOS to say how to get to hidden folders in Finder). In Terminal, you can get to it by typing "cd ~/Library/Arduino15/" at the command prompt.
 
Thanks Paul ! (and thanks a lot for all your so good and helpful work)
It's exactly the kind of folder I was looking for.

I've deleted all the Arduino and TeensyDuino IDE on my system, and also deleted this Arduino15 folder. And reinstalled the TeensyDuino, that has normally rebuild a new Arduino15 folder.
But this was not the solution I expected: the bug is still there... sometime upload takes 30s before start, and I cannot correctly read the Serial communication in the monitor window.... grmmmpfff...

Note: after click upload button on IDE, if upload does not start, Teensy is however freezed (no more blink or beep, no interactions...). Seems that Teensy each time correctly receive the ask for upload...
 
Last edited:
Sounds like you're running an older MacOS version. Is it Mojave?

As I recall, Mojave was the very last MacOS release not requiring Apple Notarization for software, so it's possible to run either Arduino IDE with the stuff added by the installer, or the stand-alone copy (which is basically just a complete copy of IDE 1.8.19 with the stuff the installer adds, digitally signed by PJRC and "stapled" with Apple Notarization). Starting with Catalina the installer way can't work (with MacOS default settings). Knowing which MacOS you're using, and if Mojave or older, knowing whether you're running the stand-alone copy with Apple Notarization or the old IDE + installer might be helpful.

Whatever version of MacOS or Arduino, I would highly recommend running Teensyduino version 1.57 or later, for 2 reasons.

#1 - Newer versions of MacOS have a very nasty kernel-level bug, which can completely crash your Mac under certain (unlikely) circumstances. The serial monitor code starting with 1.57 was completely rewritten to avoid any use of the problematic Core Foundation API (an abstraction layer which integrates unix file descriptor polling with MacOS run loops). I don't know exactly when the problem was introduced. It might have been in Big Sur or Monterey, so you might not hit this if you stay on something old like Mojave. Still, it's a very serious problem inside MacOS, which motivated a lot of work to rewrite the serial monitor code for version 1.57.

#2 - When used with Arduino IDE 1.8.x, Teensyduino 1.57 adds the ability to ignore whatever Teensy stuff is installed for use with Arduino IDE 2.x.x. If you use Teensyduino 1.56 or earlier, it can be working fine and then the moment you try IDE 2 and install the Teensy package, it forever messes up usage with IDE 1.8.19 or earlier (but deleting ~/Library/Arduino15 might fix it). Teensyduino 1.57 added a patch so Teensy usage on Arduino IDE 1.8.x ignores whatever package you've installed for use on Arduino IDE 2.x.x.

If you use Teensyduino 1.56 or earlier, you're risking these 2 known problems which Teensyduino 1.57 fixed.
 
sometime upload takes 30s before start, and I cannot correctly read the Serial communication in the monitor window.... grmmmpfff...

Blind guess on the 30 second lag, sometimes in the past on MacOS long delay turned out to be issues with a bluetooth serial device. If you can use a USB keyboard and mouse with cord, recommend turning off bluetooth to see if the problem goes away.

Which port you select in Tools > Ports matters. If Teensy has been programmed while Tools > USB Type was set to Serial (the default setting) then you should see Teensy appear twice in the Tools > Ports menu. One entry will be under "Teensy Ports" and the other will be "Serial Ports". Communication with Teensy is done very differently, depending on which you select. Knowing this, please be specific or show a screenshot of the Tools > Ports setting when talking about communication issues like the serial monitor not working.

My blind guess is you may have Serial Ports selected if you're seeing a long delay. With Serial Ports, the serial monitor will deal with the port as normal serial, which as I recall with IDE 1.8.19 uses the Java JSSC library. That way will be much more susceptible to problems with non-Teensy devices.

If you select Teensy Ports in the menu, none of the IDE's built in communication will be used. Instead the IDE will run MacOS native helper programs which Teensyduino provides.
 
And one more MacOS suggestion... if you dive into the Network settings in MacOS, you might discover many dormant or unused modem devices. MacOS tends to create these when it sees new USB serial devices, even if they're not modems. Normally these are harmless. Or at least on my test machines (admittedly mostly older model Macs) they didn't seem to cause any problem, even with hundreds of them lingering. But I can recall at least a couple times people talked about deleting them all (which MacOS turns into a slow and tedious process of clicking each one). I really doubt this will make any difference, but who knows?
 
Back
Top