Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 57 of 57

Thread: Change device name

  1. #51

  2. #52
    Junior Member
    Join Date
    Feb 2017
    Posts
    10

    Procedure to Change Name of Teensy 3.2

    Dear Teensy comunity,

    I would like to change the name of the device, I am using it in the USB Type: "Serial". When I upload the firmware into a Teensy 3.2, I get the device name: "USB Serial".

    I have found in this blog that it is possible to modify the device name, then I went to the file: C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\usb_serial and open the "usb_private.h" file and I found the "#define STR_PRODUCT L"USB Serial", I tried to modify this file and then save it. I tried to reload Arduino, compile and upload the firmware to the Teensy.

    Then I connected to another PC, one that does not known the device before, but I cannot get my customized name.

    Can someone recommend a procedure to change the Device Name of a Teensy 3.2?

    Thanks.

  3. #53
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    6,752
    IIRC - The forum has similar posts with solutions - it involves updating another element in the passed data so the computer associates it as a new device. Without that change those values tell the PC it matches the known device. Try a search - perhaps Google/Bing with relevent terms and those posts may show needed info

  4. #54
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,153
    Maybe you're using Windows 10?

    If so, perhaps the name you're seeing comes from C:\Windows\INF\USBSER.INF (which is a hidden folder, so you have to do something special to access this INF folder within the Windows system directory). If the configuration from an INF is determining the name, then it doesn't matter what name the USB descriptors give. Microsoft loves their INFs and Registry and will almost always use those when they give info.

    Trouble is, even though that file is just plain text, it also has a cryptographic signature. If you edit the file, the signature check will fail and Windows will consider it to be unsigned.

    You can create your own INF. There are lots of sites with info about how to do this. For Windows 10, you'd probably start by just copying Microsoft's USBSER.INF. You can probably leave almost everything the same, but of course you'd want to change some or all of these lines near the end:

    Code:
    [Strings]
    ; localizable
    MSFT                 = "Microsoft"
    UsbSerial.DeviceDesc = "USB Serial Device"
    UsbSerial.DriverDesc = "Microsoft USB Serial Driver"
    To get your custom INF to override the one Microsoft provides, you'd need to do 2 things.

    First, it needs to use a Hardware-Id match against the specific VID & PID. If you do this, please change the vendor ID. Don't use the same ID numbers as we use for Teensy. Either buy a number from the USB-IF (for $5000) or buy one from MCS Electronics (for €15) or make one up that's unlikely to conflict with anyone else. Google can give you lots of sites talking about which VID numbers to use "unofficially". Just please do not use the same IDs as us or anyone else actually distributing a product if you're making your own INF.

    These are the Compatible-Id match lines you need to replace with Hardware-Id matching:

    Code:
    [Standard.NTamd64]
    %UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02&Prot_01
    %UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02
    Again, there are lots of sites with specific details about these lines (but surprisingly few who will tell you the whole process like in this message) so just search for INF Vendor & Product ID matching and I'm sure you'll find this detail and lots of examples.

    Second, you must sign your INF. Or maybe there's still some way to reboot Windows into a special mode where this isn't required. But in the normal mode Windows runs, hardware ID matching overrides compatible ID matching, but no matter the matching used, signed drivers always take precedence over unsigned. So you really *must* sign your driver for it to have any effect on Windows 10, because Windows 10 will never use it if it sees the signed one in that hidden INF system folder.

    Software-wise, you need 2 command line utilities: INF2CAT and SIGNTOOL. Both of these are free from Microsoft, as part of their enormous WDK download. Even if you never intend to write a driver, as far as I know you still need to download WDK just to get those 2 little utilities.

    However, SIGNTOOL absolutely does require you to have a code signing certificate, which isn't free. Shop around. Lots of no-name sites resell the Comodo cert, for a lot less. Expect to pay about $75 to $100 for 1 year. After you go through the verification process, you'll end up the certificate. Hopefully it will comes as a .P12 file. If not, you'll need to convert it to .P12 or some other format CERTMGR can import. Then just run INF2CAT to get the .CAT file for your .INF (you can do this step before spending any money) and then run SIGNTOOL to add the signature info to the .CAT file.

    When you run SIGNTOOL, make sure to give it the /TR flag with the URL of a trusted time server. Again, knowing this is an issue, google can turn up the details. SIGNTOOL also has some help info with /?, like most of Microsoft's command line utils. The timestamp from the time service will make your signature permanent, rather than only valid for the time period you paid the certificate authority (or their discount reseller).

    All you have to do is put the .INF and .CAT into the same folder. Whenever Windows installs a INF, it will notice if a corresponding CAT file is in the same folder, and it will check if the CAT file contains a valid signature that matches the INF.

    Once you've installed the INF, you might still see the old name if using the same PC, because Microsoft loves getting stale info from the Windows Registry even when you've installed new stuff. Usually incrementing the BCD version number in the USB descriptors is the easiest way to get Windows to recognize it's a newer version and needs to do the matching against INF files again.

    That's all if you're using Windows. Things are much simpler for Macintosh and Linux.
    Last edited by PaulStoffregen; 07-10-2018 at 10:47 AM.

  5. #55
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,153
    If you go searching for driver signing info, you'll likely find very old info. The process I described applies from Vista through Windows 10.

    In Vista through Windows 8, Microsoft didn't put USBSER.INF in the Windows hidden INF folder. So on those systems you could avoid signing your driver, if you only rebooted once to the mode which ignore the signatures. Once installed, you could reboot and have the unsigned driver used. While you can (maybe) still do this, and there's probably many sites with old advice to do so, it's a moot point on Windows 10 because even if you manage to get your unsigned INF properly installed, Windows will always consider the signed one higher matching precedence and ignore yours. You have to sign for Windows 10.

    Before Vista, Microsoft had a much more difficult process called WHQL. There's probably still lots of bitterness online about the WHQL fees, which where paid directly to Microsoft. In the very early days, you had to get Microsoft to approve your driver, which not only cost money but cast a lot of uncertainty on everyone and caused a lot of resentment of Microsoft trying to control what everyone could do. Eventually they changed WHQL to a pretty much self-service model, where they would package their test suite with the WDK and you would run it yourself. When your device passed the tests, which you'd run from the comfort of your own PC, you'd send the passing report file and a check to Microsoft. As I recall, you had to pay separately for each version of Windows (so pay 3X if you want 2000 & XP and 2003 Server), but you got the 64 bit version for free if you paid for the 32 bit one. Then they'd send you the signed driver.

    I believe there may still be a process like that to get your device submitted into the repository of drivers Windows Update can automatically install. Maybe? It's been quite a while since I've looked.

    The process today, since Vista, involves only getting a code signing certificate from one of the 7 or 8 trusted certificate authorities, and then you run those utilities to sign the driver yourself.

    You *still* have the inconvenience of getting end users to actually install the INF. If you provide an installer, as we do with Teensyduino and Arduino does for their IDE, you can make it part of your installer process. Otherwise you have to get the user to install it somehow. Like so many things about Windows, it's not as simple as it should be...

  6. #56

    change device name

    when you get connected with computer or other device you must get an option of setting on the right side than press general setting bar. This option will help you to change the device name.

  7. #57
    Junior Member
    Join Date
    Jul 2018
    Posts
    1
    I would be interested to know if there is any new information on this. I have at least two Teensy-based MIDI interfaces that I will need to use on the same system soon, and juggling back-end files that shouldn't change is not one of my strong suits.





    __________________________________________________ __________________________________________________ _____________
    My stepper motor website:skysmotor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •