Teensy Qt

Koromix

Well-known member
TyTools

Hello everyone,

I have put together three tools to manage multiple Teensy devices at once, available for Windows, Linux and OS X. You can find some instructions on how to use it in the README file.

ToolTypeDescription
TyCommanderQt GUI (static)Upload, monitor and communicate with multiple boards
TyUpdaterQt GUI (static)Simple firmware / sketch uploader
tycmdCommand-line
No Qt !
Command-line tool to manage Teensy boards

All of these tools are independent binaries. Pick the executable and do what you want with it. All my code is public domain, but that is not the case for the Qt library the GUIs use.

tycommander_085.png

You can find it on my GitHub page at : github.com/Koromix/tytools (and the release notes)
The latest release is available here : github.com/Koromix/tytools/releases
 
Last edited by a moderator:
I'm using the latest versions, namely Qt Creator 3.3 and Qt 5.4. Anything beyond Qt 5.2 should do, but I haven't tested it. Next versions of TyQt will use QCommandLineParser which was introduced in Qt 5.2 so I won't support anything younger than that.

The build system uses CMake so no IDE should be needed to build ty (only GCC and Clang are supported, MSVC is out). But I do use Qt Creator to develop it.
 
I got it loaded and running yesterday. I have a couple Teensy but not yet hooked up. How long have you been using QT? I've been on it about 6 months, developing a proof of concept simulation of our embedded device. We are using 5.3, probably should move ahead. There are 5 of us so it is not quite so easy. Do you have a vision for TyQT? A long term wish list?
 
I had no prior experience with Qt itself, only C++. The Qt interface was made in a couple days but the backend code which handles the devices was already there as C code (libty). I have to say, I knew Qt was nice but now I think I fell in love with it.

The C library took longer and evolved organically from teensy_loader_cli.c for more than a year of very intermittent development (my field of study/work has nothing to do with computers, much less embedded devices). I didn't even have any coherent idea back then, it was just something for fun. You can see it in the lack of documentation ;)

My TODO/wishlist is:
- Single instance TyQt like Teensy Loader does (almost ready and will be released as TyQt 0.5.5)
- Arduino IDE integration to track and program multiple devices accurately (I've already got some code for this using JNA, but I'm waiting for the official Arduino/Teensyduino 1.6 release from Paul to finish and publish it)
- soft debugging support for running devices with GDB/LLDB (the theory is mostly mapped out, but no code out yet and it involves changes to the cores code)
- Qt Creator integration to program for Teensy directly there, without klunky Makefiles (barely investigated, there seems to be a lot of boilerplate needed for Qt Creator plugins and I'm not sure where to begin yet)

I finally bought a Teensy 3.1 so I'll test that as well in the next few days, once the mail comes.
 
- Arduino IDE integration to track and program multiple devices accurately (I've already got some code for this using JNA, but I'm waiting for the official Arduino/Teensyduino 1.6 release from Paul to finish and publish it)

Things probably won't change much between 1.21-beta6 and a final the 1.21 release in a couple weeks.

Most of the expected changes from this point forward will probably be porting libraries to Teensy-LC.
 
Things probably won't change much between 1.21-beta6 and a final the 1.21 release in a couple weeks.

OK, nice to know. Anyway I've made all my changes over the upstream Arduino IDE code without reusing your code yet. Well, except for copying hardware/teensy over and tweaking the upload commands. Once my changes work correctly (I hate Java) I'll go over your IDE modifications and cherry-pick those that apply.

This is what it looks like for now:
arduino_ide_libty.png

Meanwhile, I've updated TyQt to version 0.5.5 with support for single-instance (à la Teensy Loader) and minimal interface mode.
 
This is a great tool for managing multiple Teensy devices; nice work! It correctly sees my T2.0, T3.0 and T3.1 devices and can reset them, but it labels my (beta) Teensy LC just as "Teensy" with a serial number (444430). For options just (none), that is no upload, no reset. Is that because my LC is a beta device?
 
Thanks :)

I don't have a Teensy LC so I didn't know how to identify it. But thanks to defragster I've got the information I needed so I'll push an update soon.
 
Thanks :)

I don't have a Teensy LC so I didn't know how to identify it. But thanks to defragster I've got the information I needed so I'll push an update soon.

The usage page key 0x20 is correct for TLC (checked on my TLC)
 
Last edited:
My production LC's can do reset - only through TeensyD, without that they just get shutdown & 'cannot reset board'. I have not tried upload. Monitor and all else works of course. Koromix if there are any other screen shots or device details I can get you let me know. I still had that ghost teensy in tyqt as I Haven't rebooted yet, though I am down to only 19 open IE windows and 20 other things. I just removed the spare teensy from DevMan, ty was seeing it as an error. Ty just shows the LC&3.1 by USB 'hub path' info you already have from tyqt.

I last loaded a 3.1 hex and the reset with TeensyD halted the LC and then yelled at me, and left the LC offline - which is how TyQt left the LC without TeensyD. It might be nice to have a true reset if possible - or label it 'button' when TeensyD is active.

Here is a TeensyD verbose upload spew in case it shows you anything (once auto and again w/button): View attachment LC4Koromix.txt
 
I've released TyQt 0.6.0 just now, with tentative Teensy LC support. I'm not going to be available much until next week so I wanted to put it out there now. Tell me if it works, including on beta devices (to know if 0x1F is indeed for beta devices).

defragster: don't worry I got your email and I'll be working on it. The main problem seems to be the USB 3.0 support in Windows; it's not standardized so each controller vendor does its thing (I believe it's better in Windows 8). I'll send you a program soon to log some things and help me fix it. Unfortunately my USB 3.0 host controller was destroyed a week ago by a faulty cable that shorted so I can't test much myself right now on this front.
 
I pulled the exe's and I got this error with reset - on the recognized LC:
LC_Err_write_0.6tyqt.PNG

I saw the PROject file but still no go - see new m#14
 
Last edited:
I got this far - but suspect my version or compiler setting not right:
03:14:12: Running steps for project ty...
03:14:12: Configuration unchanged, skipping qmake step.
03:14:12: Starting: "C:\Program Files (x86)\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev1\mingw32\bin\mingw32-make.exe"
cd src\ && ( if not exist Makefile C:\Qt\5.4\msvc2013_64\bin\qmake.exe I:\ty\src\src.pro -spec win32-g++ CONFIG+=debug -o Makefile ) && C:/Program Files (x86)/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make -f Makefile
'C:/Program' is not recognized as an internal or external command,
operable program or batch file.
makefile:40: recipe for target 'sub-src-make_first-ordered' failed
mingw32-make: *** [sub-src-make_first-ordered] Error 1
03:14:13: The process "C:\Program Files (x86)\mingw-w64\i686-4.9.2-posix-dwarf-rt_v3-rev1\mingw32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project ty (kit: MinGW)
When executing step "Make"
03:14:13: Elapsed time: 00:01.
 
Looks good. I've got 4 teensy's sat here on my desk, so will give this a try later.

Is it possible, using this (either now, or planned for a later date), to identify each teensy uniquely via some sort of editable identifier?
 
There is EEprom to write to. USB connected 'Externally' they seem to have a serial # as shown in the screen shot above.
 
I would have been surprised if it worked at first, the assumption that the bootloader protocol is the same as in 3.1 and 3.0 may be wrong then. Maybe Windows rejects the HID report because it's the wrong size. A quick look into the reference manual for the mkl26z64 tells me the sector size is still 1MB, I guess the bootloader does nothing weird here.

Just like last time, here is a small DLL to help me find out the truth about it :) Try to reset the Teensy LC and send me everything that appears in the log tab.

I think the easiest way to configure Qt Creator with the correct compiler is to use the one they provide. Remove mingw-w64, reinstall Qt using the Qt installer and on the components page, enable Tools > MinGW 4.9.1 (unchecked by default).
 

Attachments

  • libty.dll.zip
    218.9 KB · Views: 275
First line from 3.1 then were about 25 lines of the same following:
report length: 1089
I/O error while writing to '\\.\HID#VID_16C0&PID_0478#9&8C23B88&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}'

Components? > Tools / Options

I should go to my other machine - that is the one I did the cleaner install on - I never fixed this one it seems.
 
Last edited:
Okay, so the output report length is correct. Something else is going on but I don't have time to investigate now. Unless Paul can tell me what changed exactly (if anything did at all, it could also be a bug lurking in my code), I'll wait for my own Teensy LC (within 1 to 3 weeks, I live in France) to fix this.

qt-mingw.png
 
That 'report length: 1089' was from the Teensy3.1 I hit first!
The other text 'I/O error...' is unchanged from what was on the earlier screen shot

Thnx for the Qt screen shot. I will repair.
 
Last edited:
Is it possible, using this (either now, or planned for a later date), to identify each teensy uniquely via some sort of editable identifier?

I already have some code to add device aliases, so they will be implemented soon(ish). You will be able to alias the device using the board's serial number and/or USB port location. And TyQt (and the CLI too) will also remember the firmware uploaded to each board, and when it was uploaded. Well, if it was done using TyQt/tyc of course, because I don't get the info from the official loader.
 
I've just tried the latest TyQt 0.6 on my Win 8.1. box, and it see's neither my 3.1 or my LC :-( Until I killed the GHOST COM4 - then TyQt worked! (Reboot or DevMan as below)

FAILURE was when TYC reported:
C:\Users\mobil_000\Downloads\TyQt-0.6.0-win32\TyQt-0.6.0-win32>tyc list
Permission denied for device '\\.\COM4'

When DevMan 'uninstalled' the GHOST COM4 TYC gave this:
C:\Users\mobil_000\Downloads\TyQt-0.6.0-win32\TyQt-0.6.0-win32>tyc list
+ usb-2-11#374970 teensy
+ usb-1-1-1#1113960 teensy


Upload storage and tracking and 'friendly' names sound like great additions.
 

Attachments

  • qtcored.dll.png
    qtcored.dll.png
    7.4 KB · Views: 508
Last edited:
Interesting, thanks for the report. I had a virtual machine running 8.1 but there were lots of problems (with Windows Update, I think), so I dropped it with the intention of doing a clean install later (which I never did). I'll have to reinstall it tomorrow to run some tests on it.
 
Yes, this is the Qt problem. If you launch it from the IDE, it should be OK because Qt Creator puts the directory with these DLLs in PATH variable. Otherwise you should copy them to the build directory from C:\Qt\5.4\mingw491_32\lib: you need icudt53.dll, icuin53.dll, icuuc53.dll, libgcc_s_dw2-1.dll, libstdc++-6.dll, libwinpthread-1.dll, Qt5Cored.dll, Qt5Guid.dll, Qt5Networkd.dll, Qt5Widgetsd.dll (take the ones without the d suffix if you build in release mode).

Yes, Qt is heavy. That's why I build TyQt with static linking but you need to build the static libraries yourself before, and even then the resulting binary is quite big.
 
Back
Top