How to change Device name on Teensy 4.0 on arduino ide 2.3.6 and win10

Hello, I have trouble renaming Teensy 4.0 USB device name, i would like to name it MYNAMETeensy, I have arduino IDE 2.3.6 and running on WIN10 pro. I did read instructions about similar renaming but on my system i cant find it., please help. thankyou
 
Windows is complicated, so there is no single simple answer to this question. Some names come from .INF files inside Windows, which you can't change and can only override by creating a signed driver. Other names like MIDI ports are fairly easy.

But to even begin an answer, you need to be very specific about exactly what name you want to change. A screenshot would be best, because again, Windows is complicated and there are many different things that can be described by similar words.
 
To be precise, I have made (making) controllers for cnc machine with teensy 4.0, and I would like to my custom name to appear in windows devices. If that is possible i would be very happy,attached photo of what displays now when i have teensy connected to usb
forum.jpg
 
I am also interested. Very usefull for applications where Teensy defines 3 USB serial ports, each for a different connection.
I have a MOXA USB-485 converter, it displays as "MOXA serial port (COM5)"
 
There is no easy or cheap way to change the words "USB Serial Device" in Windows. The name comes from an INF file within Windows which is signed by Microsoft. If you change even 1 byte within that (well hidden) file, the signature will no longer be valid and Windows won't use it.

A difficult and expensive way does exist, which is almost certainly what Moxa is doing. You would create your own INF file, which is the file type Windows uses to know which driver to load when it sees a device. If you supply your own binary kernel-mode driver code, then you must provide your own INF to cause Windows to load it when your device is detected. An INF file doesn't have to reference a custom driver. It can instruct Windows to load any of the Microsoft-provided drivers. For USB Serial implement with CDC ACM protocol (which is how Teensy and nearly all other microcontrollers do it, because it's a USB standard) that driver is USBSER.SYS.

Since somewhere in the Windows 7 era, Microsoft requires INF files to be signed. The signature is stored in a CAT file with the same name, since the INF is just a text file. Windows 2000, XP, Vista will let you install an INF without a CAT signature file after you click ok to a nasty warning message. But starting with Windows 7, unsigned INF just won't work. You must sign, which means you must have a code signing certificate. Those certs come in 2 flavors, less expensive OV and more expensive EV. If your "driver" is only an INF you can use OV. If your driver includes your own SYS file or other kernel-mode binary, then you must have the EV type.

Until a couple years ago the OV could be purchased pretty cheap (under $100/year). But policies changed. OV used to be delivered as simply a file (or by installing to a browser keychain where you could export it to a file), whereas EV was delivered only on a hardware token (usually Yubikey FIPS). They no longer issue OV as a simple file (cryptography experts would cringe at details I'm glossing over here to keep this short...) Most of the certificate authories now offer a cloud service. Like anything "cloud" you avoid initial up front costs, but then pay per use which might be beneficial if you have only light duty usage, quickly becomes even more expensive as you use it more.

Before Windows 10, Microsoft supplied USBSER.SYS (though it was buggy) in all versions of Windows back to at least Windows 2000, though before XP-SP3 and Vista-SP1 (and all service packs to Windows 2000) USBSER.SYS didn't support USB composite descriptors which are now commonly used. Because Windows XP and Windows 7 (and other versons before 10) didn't supply any INF to actually load USBSER.SYS, supplying an INF which just loads USBSER.SYS was pretty common practice. If you search, I'm sure you can find many old INF examples just to load USBSER.SYS. Since INF is just a text file, simply open it with a text editor and change the name and ID numbers to whatever you like. Then run signtool (part of the free Windows SDK) to create a corresponding CAT file.

A critically important part of your INF is the Hardware ID string. This will have the Vendor ID and Device ID numbers. Ideally you would alter the Vendor ID number used on Teensy to one you've been assigned from the USBIF (yet another very expsensive thing...) and of course put the same number into your INF. The INF inside Windows uses "Compatible ID" matching rather than "Hardware ID" matching, so it can load for all devices which say they use the CDC-ACM protocol. Windows considers Hardware ID matching a higher priority, so when it has multiple INFs for a device the one with Hardware ID (if properly signed) overrives any using Compatible ID.

Microsoft has a policy that only they can publish INF files using Compatible ID matching. Earlier versions of Windows only enforced this policly in the signtool program. Long ago, PJRC created a INF with Compatible ID. If you run the Teensyduino installer on any pre-10 version of Windows, and the INF isn't already installed, you'll get a step to install that INF "driver" (of course the actual driver is just USBSER.SYS within Windows).

If you decide to go down this custom INF path, you can indeed change the name. It is possible, but difficult and expensive (costs associated with the code signing cert). Since Windows 10 added its own INF with Compatible ID, all this painful INF stuff has been a distant painful memory for me. I'm really glad to no longer have to mess with it. I will admit, it's been many years and my memory of the finer details has faded somewhat. If you do go down this path and find something I've said here isn't quite right, please feel free to post a correction. Maybe even share your experience, as it might help others who want to do this, since most of the info online was written when Windows XP and 7 where the commonly used versions.
 
Paul, thank you very much for many extensive lines of explanation, it must be like you wrote, because I was searching and reading about this and I just didnt find any direction to take on. I am happy that i can make my projects with Teensy.
 
Paul -
How would you change the name of a Teensy 4.1 so that it appeared differently in EITHER the tools/port section of the IDE or at the top pull down where it ordinarily just says 'Teensy4.1'?

Maybe a better way to phrase this question is how would you recommend keeping track of multiple active Teensy's in Arduine IDE so that whatever code one is working on can get compiled and uploaded to the correct Teensy?
Jon
 
Each Teensy presents a unique Serial Number to USB if that helps.
Here using TyCommander's "TyCmd list" feature it shows the three I have connected:
Code:
T:\T_Drive\TyComm>tycmd list
add 7658850-Teensy Teensy 4.1 (USB Serial)
add 9706370-Teensy Teensy 4.1 (USB Serial)
add 16863840-Teensy Teensy 4.1 (USB Serial)

And the unique device information is shown in the TyCommander UI as well:
1754760672284.png
 
@jonweisw2 - and TyCommander will allow/remember associating a friendly name for each ser# ID'd Teensy as well
And the IDE can be told to connect with TyCommander as noted here: https://forum.pjrc.com/index.php?threads/teensy-qt.27825/post-356530
> on IDE upload it presents a Dialog for 'which Teensy gets this sketch' - then it shuts off that Serial and triggers a Bootloader that uses PJRC Loader to do the upload and then that sketch is associated with that Teensy for the duration or until 'Drop'd:
1754771198584.png
 
Back
Top