Koromix / tytools

Collection of tools to manage Teensy boards
https://koromix.dev/tytools
The Unlicense
214 stars 27 forks source link

Compatibility to upcoming Teensyduino version #64

Closed luni64 closed 3 years ago

luni64 commented 3 years ago

The currently worked on version of Teensyduino changes the so far used device level CDC class to a composite device. Looks like the TyTools are not happy with this. The device manager shows the Teensy as e.g. COM3, Teensy.exe uploads correctly, but the TyTools detect it at COM4 which of course won't work. However, using the Teensy in dual / triple serial mode works normally.

Here the differences in the generated devices before and after the change.

The old version generates this device USB\VID_16C0&PID_0483\8077220
The new version generates this device: USB\VID_16C0&PID_0483&MI_00\7&922067D&0&0000

See here for some more information https://forum.pjrc.com/threads/63695-malloc-free-for-EXTMEM-and-DTCM?p=257329&viewfull=1#post257329

I can send you a .hex showing the effect if you wan't

Koromix commented 3 years ago

Yes, a .hex would be nice (for T4.0, I don't have a T4.1), or instructions on where to find the version of Teensyduino that does this. I don't really follow Teensy development anymore. Thanks :)

Do you use Windows 10 or Windows 7?

Defragster commented 3 years ago

This is on Windows 10. It is based on pending changes on github to CORES.

I built two HEX files that fail on TyCommander - not sure if they demonstrate the problem as you need to see it?

Did a 15s Restore to get them back right ???

Hi Niels.

Removed zip - not sure it is what is needed

luni64 commented 3 years ago

I'm on Win10. Here, two hex files compiled with the old (current) and the new (upcoming) Teensyduino:

old_TD.zip: image

new_TD.zip image

Device Manager reports COM8 for new_TD.hex, TyTools detects COM7.

#include "Arduino.h"
void setup()
{
  while (!Serial) {  }
  Serial.println("Hello TyTools");
}
void loop(){
}

Here the log

Received removal notification for device 'USB\VID_16C0&PID_0483&MI_00\8&2A11B0DC&0&0000'
Received removal notification for device 'USB\VID_16C0&PID_0483\6239370'
Remove device 'USB\VID_16C0&PID_0483\6239370'
Received arrival notification for device 'USB\VID_16C0&PID_0478\00098541'
Examining device node 'USB\VID_16C0&PID_0478\00098541'
Device 'USB\VID_16C0&PID_0478\00098541' has no 'PortName' registry property
Received arrival notification for device 'HID\VID_16C0&PID_0478\8&2F77DAF&2&0000'
Examining device node 'HID\VID_16C0&PID_0478\8&2F77DAF&2&0000'
Found port number of 'USB\VID_16C0&PID_0478\00098541': 4
Found port number of 'USB\VID_0409&PID_0059\6&33F0F426&0&4': 4
Found port number of 'USB\VID_0409&PID_0059\5&2B739175&0&2': 2
Found controller ID for 'USB\ROOT_HUB20\4&8FC751&0': 8
Add HID device 'USB\VID_16C0&PID_0478\00098541' on iface 0
  - USB VID/PID = 16c0:0478, USB location = usb-8-2-4-4
  - USB manufacturer = (none), product = (none), S/N = 00098541
  - HID usage page = 0xff9c, HID usage = 0x24
Identified 'Teensy 4.0' with usage value 0x24
[upload@6239370-Teensy] Uploading to board '6239370-Teensy' (Teensy 4.0)
[upload@6239370-Teensy] Firmware: smmalloc.hex
[upload@6239370-Teensy] Flash usage: 17 kiB (0.8%)
[upload@6239370-Teensy] Sending reset command
Received removal notification for device 'HID\VID_16C0&PID_0478\8&2F77DAF&2&0000'
Received removal notification for device 'USB\VID_16C0&PID_0478\00098541'
Remove device 'USB\VID_16C0&PID_0478\00098541'
Received arrival notification for device 'USB\VID_16C0&PID_0483\6239370'
Examining device node 'USB\VID_16C0&PID_0483\6239370'
Found port number of 'USB\VID_16C0&PID_0483\6239370': 4
Found port number of 'USB\VID_0409&PID_0059\6&33F0F426&0&4': 4
Found port number of 'USB\VID_0409&PID_0059\5&2B739175&0&2': 2
Found controller ID for 'USB\ROOT_HUB20\4&8FC751&0': 8
Add serial device 'USB\VID_16C0&PID_0483\6239370' on iface 0
  - USB VID/PID = 16c0:0483, USB location = usb-8-2-4-4
  - USB manufacturer = Teensyduino, product = USB Serial, S/N = 6239370
Identified 'Teensy 4.0' with bcdDevice value 0x279
Received arrival notification for device 'USB\VID_16C0&PID_0483&MI_00\8&2A11B0DC&0&0000'
Examining device node 'USB\VID_16C0&PID_0483&MI_00\8&2A11B0DC&0&0000'
Found port number of 'USB\VID_16C0&PID_0483\6239370': 4
Found port number of 'USB\VID_0409&PID_0059\6&33F0F426&0&4': 4
Found port number of 'USB\VID_0409&PID_0059\5&2B739175&0&2': 2
Found controller ID for 'USB\ROOT_HUB20\4&8FC751&0': 8
Device 'COM7' not found
Defragster commented 3 years ago

@Koromix - do you need anything else to get to the bottom of this?

It seems that change is coming to Teensy and TyCommander fails and having to use the IDE for SerMon is a step backwards.

If you get a version for testing just post

Koromix commented 3 years ago

Sorry for the delay.

Yeah I could not reproduce it on my T4.0 with your firmware. I don't know if it has to do with the T4.0 or something else, but I've just bought a T4.1 anyway. It should arrive next wednesday (25/11) and I will resume tests at this time, unless you can reproduce it yourself on a T4.0.

luni64 commented 3 years ago

Sorry for my late answer I was sick the last week. I can still reproduce this on a T4. If you load the old version and then the new version Windows will assign a new port number because it sees a new device (composite with one cdc in the new FW opposed to a plain cdc with the old FW) Looks like the tyTools somehow uses the wrong comport.

Let me know if you want me to test something.

Defragster commented 3 years ago

Indeed something problematic in the new TD1.54 beta change. I've been using Dual Serial to work around.

Koromix commented 3 years ago

Sorry for my late answer I was sick the last week. I can still reproduce this on a T4. If you load the old version and then the new version Windows will assign a new port number because it sees a new device (composite with one cdc in the new FW opposed to a plain cdc with the old FW) Looks like the tyTools somehow uses the wrong comport.

Let me know if you want me to test something.

OK thanks for the repro recipe, I'll try that tonight (it's 9:30 AM here) and get back to you.

Koromix commented 3 years ago

The latest commit should fix this (it does on my machine). You can find a build here: https://koromix.dev/files/tytools/

luni64 commented 3 years ago

Just tested it, works perfectly for me. Thanks a lot

Defragster commented 3 years ago

Grabbing it to go back to back to normal TyComm usage ...

Defragster commented 3 years ago

Seems to be working well with single Serial now!

Defragster commented 3 years ago

@luni64 - grab the last linked exe from here https://github.com/Koromix/tytools/issues/69

Above test build had a QT fault issue