Teensy Qt

Teensy is awesome - and TyComm makes it better. TeensyLoader is good but matching the IDE focus on a single board leaves room for improvement with multiple Teensy. Especially when it comes to SerMon! And TyCommander has a great UI and function to address that very well for upload and SerMon.
 
I've been playing with CANBus on a couple of Teensy's and TyCommander makes it so much more convient to develop and test on multiple devices. As a novice programmer I can really appreciate the brain power that has gone into development of a program like this.
 
Just made a new release (0.9.5), it adds a per-board setting to change RTC programming (localtime, UTC or ignore)
Here you go: https://github.com/Koromix/tytools/releases/tag/v0.9.5

TyCommander_RTC.png
 
I just found this project and tried it out. I like it! The GUI program is pretty nice and useful. I left an issue on GitHub because uploading isn't working. But, other than that things look pretty good to me. I'm glad this project exists.
 
I just found this project and tried it out. I like it! The GUI program is pretty nice and useful. I left an issue on GitHub because uploading isn't working. But, other than that things look pretty good to me. I'm glad this project exists.

Thanks ;)

Indeed, I broke some stuff in 0.9.6.. :p
Should be fixed in 0.9.7!
 
I've been using tycmd, driven from a Mac App (made in Visual Studio in Xamarin).
It had been working well!
Now I'm working through problem with the environments (VS, Xcode, Mac OS/certificates/IDs... etc.) as I try to modify the app... after having updated my Mac to an M1.

I'd love to build the tycmd code into my own Mac app, natively in Xcode.
I see the TyCommander app here
and the source code here for what I think is the command-line tools

Should I be seeing source and an Xcode project for the tool with the GUI?

I appreciate your help, thanks for the tycmd tools!
 
Oh, I just read back to the beginning of this thread and see that you've used QT for the apps with user interface.
I think I'll give it a whirl in Xcode. I need only three functions:
- find a connected Teensy;
- sends and receive serial commands/responses; and
- flash it with a HEX file I download from the web.

If anyone has a Swift project that stubs this out with TyCmd and they'd be willing to share, you'd have my undying gratitude.
 
Truly great software. It's actually the only one that really works with the MicroMod if you have a big file. We have a 19.5mb HEX file and it's growing as we develop the firmware.
TeensyDuino times out and turns of Auto mode because erasing the flash takes to long. TyTools works just fine. I just need to find a way to succeed in editing TyTools (just want to make my own GUI for it).

Great work!
 
Truly great software. It's actually the only one that really works with the MicroMod if you have a big file. We have a 19.5mb HEX file and it's growing as we develop the firmware.
TeensyDuino times out and turns of Auto mode because erasing the flash takes to long. TyTools works just fine. I just need to find a way to succeed in editing TyTools (just want to make my own GUI for it).

Great work!

Long time TyTools user/supporter as is evident by recurring posts here and about.

@Dogbone06: is the TeensyDuino version current with 1.56 or 1.57 in Beta? PJRC did increase the timeout for loader. If there is a problem in those latest versions, please post on the TD 1.57 beta thread (currently b2)

Paul will want to know of the timeout failure if reproducible on the latest. The code was changed to only erase the used flash - but in a huge case that will be mostly ALL, so perhaps it still fails where the MicroMod has 16MB Flash.
 
Long time TyTools user/supporter as is evident by recurring posts here and about.

@Dogbone06: is the TeensyDuino version current with 1.56 or 1.57 in Beta? PJRC did increase the timeout for loader. If there is a problem in those latest versions, please post on the TD 1.57 beta thread (currently b2)

Paul will want to know of the timeout failure if reproducible on the latest. The code was changed to only erase the used flash - but in a huge case that will be mostly ALL, so perhaps it still fails where the MicroMod has 16MB Flash.

defragster, thanks for pitching in! I'm using PIO and they just released an update (atleast that's what a friend told me) so I am going to update my packages in there and see if that helps. TyTools works very good tho so I might stick with that.

EDIT: I have TeensyLoader 1.55, seems to be the latest. TeensyLoader times out with our 19.5mb hex file. It turns of Auto, I can still click uploader after this happens. Because by then the flash has been erased. But I am just going to use the custom upload command in PIO and have it use TyTools CMD.
 
Last edited:
defragster, thanks for pitching in! I'm using PIO and they just released an update (atleast that's what a friend told me) so I am going to update my packages in there and see if that helps. TyTools works very good tho so I might stick with that.

EDIT: I have TeensyLoader 1.55, seems to be the latest. TeensyLoader times out with our 19.5mb hex file. It turns of Auto, I can still click uploader after this happens. Because by then the flash has been erased. But I am just going to use the custom upload command in PIO and have it use TyTools CMD.

Sorry was just wondering how you fit a 19.5MB hex file? I believe the flash is only 16MB (or 128 MBits)

Yes TyTools works well for lots of things. Although for most things now, like when I am building within Sublime Text, I use Defragsters option to allow the build to go off and use Teensy Loader to do the uploads.

As for erasing the whole chip: I am not really sure if the TyCommander is in control of that. That is, I believe the bootloader chip is in control of that, and it looks for certain things in the image to decide how much of the chip needs to be erased. More details up on the page: https://www.pjrc.com/teensy/td_code_security.html
A couple of Caveats - this is only possible if your bootloader on your chip has been updated to at least 1.07. The 1.56 Teensyduino release has the code in the Teensy app that will update the firmware in the the boot loader chip.

And if your setup is using custom linker files and the like, then there are certain things in the image that the loader is looking for.

I found out more about this when I worked on a fix for CircuitPython builds to retain their filesystem. Still also want to go back and do similar for MicroPython.

Good luck
 
@KurtE - I assumed the 'ascii' .HEX was fatter than the resulting binary after upload. i.e. the 19.5 MB had to upload to less than 16MB stored in Flash, especially if the code is still growing.
 
@KurtE - I assumed the 'ascii' .HEX was fatter than the resulting binary after upload. i.e. the 19.5 MB had to upload to less than 16MB stored in Flash, especially if the code is still growing.
You may be right.

But it might be a good thing to have the additional information, like the build summary data to maybe get an idea of if/why the Teensy app was failing to upload.

Again I am assuming Teensy app and not Teensy_loader_cli, but if for example it is Teensy_loader_cli, maybe the internal buffer that stores all of the data once it is read out of the file maybe is not big enough. Or maybe...
 
Indeed - more build info needed - but this isn't the thread for a PJRC Loader issue.
Should be tested with TD 1.56 or 1.57b2 - ideally in IDE like 1.8.19

Quick build of:
teensy_size: Memory Usage on Teensy 4.1:
teensy_size: FLASH: code:999520, data:332296, headers:8596 free for files:6786052
teensy_size: RAM1: variables:87200, code:41464, padding:24072 free for local variables:371552
teensy_size: RAM2: variables:24736 free for malloc/new:499552

That is using under 1.4 MB of T_4.1's 8 MB Flash, with over 6.7 MB free.

The generated HEX is, even the paired eHex is 500KB smaller:
06/09/2022 01:54 PM 3,238,173 Code4Code.ino.ehex
06/09/2022 01:54 PM 3,770,363 Code4Code.ino.hex
 
Just made a new release (0.9.8), with:

- Support Teensy USB Type Serial + MTP (@KurtE)
- Support infinite log size

Here you go: https://github.com/Koromix/tytools/releases/tag/v0.9.8

Thanks,

I downloaded it today and I am giving it a try, but I believe there may be an issue with the new log size stuff.

That is I am running a sketch that outputs lots of stuff to it, which is fine.

But I want to search on the data for some things, so I do a select all (or ctrl-a) and then Copy (ctrl-c)
I go to my sublime text, create new buffer and do a paste,

And I am not getting the whole thing. In the current case only the first 176 lines (last is partial), and in this case not what I was looking for.

But if I then go back and select a portion of it near the end and copy/paste it does show up.

Not that is pertinent, but I highlighed in red what I was looking for

Code:
HID Report Descriptor (0x20008fdc) size: 300
  05 01	// Usage Page(1) - Generic Desktop
  09 06	// Usage(6) -(Keyboard)
  A1 01	// Collection(1) top Usage(10000)
    85 01	// Report ID(1)
    75 01	// Report Size(1)
    95 08	// Report Count(8)
    05 07	// Usage Page(7) - Keycode
    19 E0	// Usage Minimum(e0) - (Left Control)
    29 E7	// Usage Maximum(e7) - (Right GUI)
    15 00	// Logical Minimum(0)
    25 01	// Logical maximum(1)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    95 01	// Report Count(1)
    75 08	// Report Size(8)
    81 03	// Input(3)	// (Constant, Variable, Absolute)
    95 05	// Report Count(5)
    75 01	// Report Size(1)
    05 08	// Usage Page(8) - LEDs
    19 01	// Usage Minimum(1) - 
    29 05	// Usage Maximum(5) - 
    91 02	// Output(2)	// (Data, Variable, Absolute)
    95 01	// Report Count(1)
    75 03	// Report Size(3)
    91 03	// Output(3)	// (Constant, Variable, Absolute)
    95 06	// Report Count(6)
    75 08	// Report Size(8)
    15 00	// Logical Minimum(0)
    26 FF 00	// Logical maximum(ff)
    05 07	// Usage Page(7) - Keycode
    19 00	// Usage Minimum(0) - (Keycode 0)
    29 FF	// Usage Maximum(ff) - (Keycode 255)
    81 00	// Input(0)	// (Data, Array, Absolute)
    C0	// End Collection
  05 0C	// Usage Page(c) - Consumer
  09 01	// Usage(1) -(Consumer Controls)
  A1 01	// Collection(1) top Usage(c0000)
    85 02	// Report ID(2)
    15 00	// Logical Minimum(0)
    25 01	// Logical maximum(1)
    75 01	// Report Size(1)
    95 12	// Report Count(12)
    0A 23 02	// Usage(223) -(AC Home)
    0A 8A 01	// Usage(18a) -(AL Email Reader)
    0A 24 02	// Usage(224) -(AC Back)
    0A 25 02	// Usage(225) -(AC Forward)
    0A 21 02	// Usage(221) -(AC Search)
    09 CD	// Usage(cd) -(Pause/Continue)
    09 B7	// Usage(b7) -(Stop)
    09 B6	// Usage(b6) -(Scan Previous Track)
    09 B5	// Usage(b5) -(Scan Next Track)
    09 E9	// Usage(e9) -(Volume Up)
    09 EA	// Usage(ea) -(Volume Down)
    09 E2	// Usage(e2) -(Mute)
    0A 94 01	// Usage(194) -(AL Local Machine Browser)
    0A 92 01	// Usage(192) -(AL Calculator)
    0A 83 01	// Usage(183) -(AL Consumer Control Configuration)
    0A 2A 02	// Usage(22a) -(AC Bookmarks)
    0A 26 02	// Usage(226) -(AC Stop)
    0A 27 02	// Usage(227) -(AC Refresh)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    95 01	// Report Count(1)
    75 06	// Report Size(6)
    81 03	// Input(3)	// (Constant, Variable, Absolute)
    C0	// End Collection
  05 0C	// Usage Page(c) - Consumer
  09 01	// Usage(1) -(Consumer Controls)
  A1 01	// Collection(1) top Usage(c0000)
 [COLOR="#FF0000"]   85 03	// Report ID(3)
    05 01	// Usage Page(1) - Generic Desktop
    09 06	// Usage(6) -(Keyboard)
    A1 02	// Collection(2)
    05 06	// Usage Page(6) - Generic Device Controls
    09 20	// Usage(20) -(Battery Strength)
    15 00	// Logical Minimum(0)
    26 FF 00	// Logical maximum(ff)
    75 08	// Report Size(8)[/COLOR]
    95 01	// Report Count(1)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    C0	// End Collection
  C0	// End Collection
  05 01	// Usage Page(1) - Generic Desktop
  09 80	// Usage(80) -(?)
  A1 01	// Collection(1) top Usage(10080)
    85 04	// Report ID(4)
    15 00	// Logical Minimum(0)
    25 01	// Logical maximum(1)
    75 01	// Report Size(1)
    95 01	// Report Count(1)
    09 82	// Usage(82) -(System Sleep)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    95 01	// Report Count(1)
    75 07	// Report Size(7)
    81 03	// Input(3)	// (Constant, Variable, Absolute)
    C0	// End Collection
  05 0C	// Usage Page(c) - Consumer
  09 01	// Usage(1) -(Consumer Controls)
  A1 01	// Collection(1) top Usage(c0000)
    85 05	// Report ID(5)
    05 01	// Usage Page(1) - Generic Desktop
    09 06	// Usage(6) -(Keyboard)
    A1 02	// Collection(2)
    06 00 FF	// Usage Page(ff00) - Vendor Defined
    25 01	// Logical maximum(1)
    75 01	// Report Size(1)
    95 02	// Report Count(2)
    0A 03 FE	// Usage(fe03) -
    0A 04 FE	// Usage(fe04) -
    81 02	// Input(2)	// (Data, Variable, Absolute)
    95 06	// Report Count(6)
    81 03	// Input(3)	// (Constant, Variable, Absolute)
    C0	// End Collection
  C0	// End Collection
  05 0C	// Usage Page(c) - Consumer
  09 01	// Usage(1) -(Consumer Controls)
  A1 01	// Collection(1) top Usage(c0000)
    85 FF	// Report ID(ff)
    05 06	// Usage Page(6) - Generic Device Controls
    95 01	// Report Count(1)
    75 02	// Report Size(2)
    19 24	// Usage Minimum(24) - (Security Code Entered)
    29 26	// Usage Maximum(26) - (Security Code cleared)(?)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    75 06	// Report Size(6)
    81 01	// Input(1)	// (Constant, Array, Absolute)
    C0	// End Collection
  05 0C	// Usage Page(c) - Consumer
  09 01	// Usage(1) -(Consumer Controls)
  A1 01	// Collection(1) top Usage(c0000)
    85 11	// Report ID(11)
    15 00	// Logical Minimum(0)
    25 01	// Logical maximum(1)
    75 01	// Report Size(1)
    95 03	// Report Count(3)
    81 01	// Input(1)	// (Constant, Array, Absolute)
    75 01	// Report Size(1)
    95 01	// Report Count(1)
    05 0C	// Usage Page(c) - Consumer
    09 B8	// Usage(b8) -(Eject)
    81 02	// Input(2)	// (Data, Variable, Absolute)
    06 FF 00	// Usage Page(ff) - Other ?
    09 03	// Usage(3) -
    81 02	// Input(2)	// (Data, Variable, Absolute)
    75 01	// Report Size(1)
    95 03	// Report Count(3)
    81 01	// Input(1)	// (Constant, Array, Absolute)
    C0	// End Collection
<<(02 0x200061e0 17):48 20 0D 00 09 00 71 00 A1 03 D0 20 76 50 06 66 B5 

=====================
<<(02):48 20 0D 00 09 00 71 00 A1 03 D0 20 76 50 06 66 B5 
HID HDR Data: len: 9, Type: 3 Con:0
KBD::process_bluetooth_HID_data:  03 D0 20 76 50 06 66 B5
HID (C0000) key press:20 - +10
<<(02 0x200061e0 18):48 20 0E 00 0A 00 71 00 A1 01 00 00 0F 00 00 00 00 00 

=====================
<<(02):48 20 0E 00 0A 00 71 00 A1 01 00 00 0F 00 00 00 00 00 
HID HDR Data: len: 10, Type: 1 Con:0
KBD::process_bluetooth_HID_data:  01 00 00 0F 00 00 00 00 00
key 'l'  108 MOD: 0 OEM: F LEDS: 0
OnRawPress keycode: F Modifiers: 0
key '

And it also only extracted a portion of what I selected. In this case I did not include later in this where that report was generated by the BT device:
Code:
KBD::process_bluetooth_HID_data:  03 CF 20 76 50 06 66 B5
HID (C0000) key press:20 - +10

Which my code is not setup to handle yet, but...
 
Repost from 1.58 Beta 3 thread:

For anyone {USER} using TyCommander - or looking for an IDE 2.0.3 solution to the symptom of poor Serial Monitor connectivity/usage.

Install TyCommander to some {PLACE}

Then in proper teensy {ver #} folder <on Windows>: C:\Users\{USER}\AppData\Local\Arduino15\packages\teensy\hardware\avr\{ver #}

Make this: "C:\Users\{USER}\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\platform.local.txt"
Code:
tools.teensyloader.cmd.path=[B]{PLACE}[/B]\TyCommanderC.exe
tools.teensyloader.upload.pattern="{cmd.path}" upload --autostart --wait --delegate "{build.path}/{build.project_name}.hex"

The key there is the "--delegate" that @koromix added. The IDE will open TyCommander and ask "what Teensy" {it then associates that sketch and won't ask again}, it takes 'Serial' offline into bootloader which inspires Teensy Loader to upload the indicated .Hex or .eHex file to the chosen Teensy where it comes back online with TyCommander holding the link to SerMon restored.

TyCommander can upload normal '.Hex' but, Only Teensy.exe can upload '.eHex' to Encrypted 1062's and this '--delegate' makes that happen, and in this case effectively allows 'Integrate to Arduino IDE 2' where TyCommander goes offline allowing upload and resume of SerMon.

This gives a SerMon that reliably works for one or more connected Teensy devices. Same sketch will upload to same model Teensy clicking TyCommander GUI Bootloader (or Reset). To build same sketch for different model Teensy in the GUI first 'Right click the associated Teensy' and click 'Drop association' to prevent say 'T_4.1 .hex going toward a T_4.0' and failing.

View attachment 30374
 
Last edited:
Repost from 1.58 Beta 3 thread:

For anyone {USER} using TyCommander - or looking for an IDE 2.0.3 solution to the symptom of poor Serial Monitor connectivity/usage.

Install TyCommander to some {PLACE}

Then in proper teensy {ver #} folder <on Windows>: C:\Users\{USER}\AppData\Local\Arduino15\packages\teensy\hardware\avr\{ver #}

Make this: "C:\Users\{USER}\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.58.3\platform.local.txt"
Code:
tools.teensyloader.cmd.path=[B]{PLACE}[/B]\TyCommanderC.exe
tools.teensyloader.upload.pattern="{cmd.path}" upload --autostart --wait --delegate "{build.path}/{build.project_name}.hex"

The key there is the "--delegate" that @koromix added. The IDE will open TyCommander and ask "what Teensy" {it then associates that sketch and won't ask again}, it takes 'Serial' offline into bootloader which inspires Teensy Loader to upload the indicated .Hex or .eHex file to the chosen Teensy where it comes back online with TyCommander holding the link to SerMon restored.

TyCommander can upload normal '.Hex' but, Only Teensy.exe can upload '.eHex' to Encrypted 1062's and this '--delegate' makes that happen, and in this case effectively allows 'Integrate to Arduino IDE 2' where TyCommander goes offline allowing upload and resume of SerMon.

This gives a SerMon that reliably works for one or more connected Teensy devices. Same sketch will upload to same model Teensy clicking TyCommander GUI Bootloader (or Reset). To build same sketch for different model Teensy in the GUI first 'Right click the associated Teensy' and click 'Drop association' to prevent say 'T_4.1 .hex going toward a T_4.0' and failing.

View attachment 30374

What is the recommended way to integrate tycommander to IDE 2.0.4 for a Raspberry Pi(64 bit)? In IDE1, I knew where the files were. In IDE2, umm, I have no idea where they are stored? This is the appImage from https://github.com/koendv/arduino-ide-raspberrypi - since there doesn't appear to be an easy way to build the IDE and Arduino seems to have abandoned RPI.
 
@defragster trying to get this to work on an RPI4. A little fuzzy on what actually goes in the { }. You have a {cmd.path}, {build.path} and a {build.project_name}.
In the IDE1, one needed to open tycommander and click Tools > Integrate to Arduino. Do I need to do that for IDE2? If so, where is the Arduino path? /temp/Arduino ? When I select anything in /temp it says it is not a valid Arduino directory.

I created a file local.platform.txt in /home/bruce/.arduino15/packages/teensy/hardware/avr/0.58.3 (Soon to be updated, but one step at a time...) Contents of file right now are:
Code:
tools.teensyloader.cmd.path=/home/bruce/Apps/tytools-0.9.7/build/linux/tycommander
tools.teensyloader.upload.pattern="{cmd.path}" upload --autostart --wait --delegate "{build.path}/{build.project_name}.hex"
Is it that I need to update tycommander? A bit lost here...
 
Back
Top