Change device name

Status
Not open for further replies.
Hi,
i am trying to change the USB device name of Teensy 3.1 to a custom one such as ControlModule, i have read some posts on how to change the usb_desc file, but i am not getting a clear idea, i tried changing device name in usb desc file, also adding usb_names.h in the code and uploaded the program to the board just to see if anything changes.but nothing changes.

Can anyone provide some hints on the steps involved in changing the usb descriptor/name of teensy 3.1. At present the device shows up as "Teensy USB serial" but the header files show the name as manufacturer name as teensyduino and product name as USB serial. My assumption was that the device should show as "Teensyduino USB serial". Can anybody give an idea about where i am going wrong.

Thanks
Venkatesh

#if defined(USB_SERIAL)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x0483
#define DEVICE_CLASS 2 // 2 = Communication Class
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'U','S','B',' ','S','e','r','i','a','l'}
#define PRODUCT_NAME_LEN 10
 
Are you using Windows? With Windows, you also have to increase the BCD version number, or change the USB vid or pid.

Microsoft loves caching stuff in their Windows Registry, even if it's info they have to read from the device during USB enumeration. You have to change at least one of those 3 number to get Windows to use the new info.
 
Hi Paul,
i am not able to use teensy 3.1 on windows 8.1, the serial installer driver seems to be the issue as it works well with windows 7 and windows 8. I see an error stating USB device enumeration failed in device manager. i have tried this on three windows 8.1 machines, one was a new one.

Any ideas on how i could solve this.

Thanks
Venkatesh
 
Hi Paul,
i am not able to use teensy 3.1 on windows 8.1
.....
Any ideas on how i could solve this.

I don't even really have an idea of what's wrong, from only this message.

Normally programming of Teensy uses only the HID driver, not serial. I can't tell from your message is this is a problem where Teensy doesn't work at all with your computer, or if the HID stuff is working (and you can or can't program it with Teensy Loader) but you're having issues with USB serial.

So, first, can you run Teensy Loader? When you press the button, does Windows see a HID device with ID 16C0:0478? Does Teensy Loader recognize it?

Can you run Arduino? Can Arduino program the LED blink? Does the LED actually blink at whatever speed you program in the code?

Details matter....
 
I don't even really have an idea of what's wrong, from only this message.

Normally programming of Teensy uses only the HID driver, not serial. I can't tell from your message is this is a problem where Teensy doesn't work at all with your computer, or if the HID stuff is working (and you can or can't program it with Teensy Loader) but you're having issues with USB serial.

So, first, can you run Teensy Loader? When you press the button, does Windows see a HID device with ID 16C0:0478? Does Teensy Loader recognize it?

Can you run Arduino? Can Arduino program the LED blink? Does the LED actually blink at whatever speed you program in the code?

Details matter....

Paul,
I can run arduino ide and its working fine. Tested with an arduino clone board that uses cp2102 usb to uart device.

The teensy loader gets launched but does not highlight anything, it is just as if it is a static image. probably this means teensy loader does not recognize the device.

I can see the teensy 3.1 board under list of boards in arduino ide but no ports are listed. Regarding the HID stuff, I am not sure whether it still works as an HID as i had programmed the teensy board for a small daq application. I was trying for the default factory code on your website but could not locate it.
The code is to just reading the adc data and send to the serial port, this was the reason I had installed serial drivers for windows from your website. the code is same as ADXL3xx example in ardunio ide under sensors.

My laptop had both 2.0 and 3.0 revision usb ports. There are two types of error, one associated with USB 2.0 and other with 3.0.

For USB 2.0 port, Teensy name shows up in device manager with a yellow exclamation mark under com ports. when checked in the properties tab, it shows an error as below.
This device cannot start. (Code 10)
A request for the USB BOS descriptor failed.

For USB 3.0 port, Teensy usb descriptor name is not shown in device manager, under usb controllers tabs, I get an error statement stating .

Unknown USB Device (Device enumeration failed)

I see a lot of similar issues in windows 8.1 on the internet, meanwhile I will try some methods anyway. Please convey if you are not clear or wish to know anything more regarding this issue.

Thanks
Venkatesh
 
I'm working on a product for a startup I work at. Im using a Teensy 3.1 and it would look considerably more professional if it wouldn't show up as "Teensy USB Serial" in the device manager in windows.

I've been able to successfully get the Device Manager to see the new VENDOR_ID and PRODUCT_ID when I change them in usb_desc.h but no matter what I put in the PRODUCT_NAME field it doesn't change. I've also tried to increment the bcdDevice" field in usb_desc.c to try to get windows to see that something has changed and while this does also update in the Device Manager the new Device Description is still not shown.

I've also tried some of the methods that involve modifying usb_names.h (discussed here: https://forum.pjrc.com/threads/23796-How-to-change-Teensy-3-0-PRODUCT_NAME)

I'm running on Windows 8.1, not sure if that matters.

/*Modified Section in usb_desc.h*/
#if defined(USB_SERIAL)
#define VENDOR_ID 0x16C7
#define PRODUCT_ID 0x0484
#define DEVICE_CLASS 2 // 2 = Communication Class
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
// #define PRODUCT_NAME {'U','S','B',' ','S','e','r','i','a','l'}
// #define PRODUCT_NAME_LEN 10
#define PRODUCT_NAME {'C','A','T',' ','S','e','r','i','a','l'}
#define PRODUCT_NAME_LEN 10
#define EP0_SIZE 64
#define NUM_ENDPOINTS 4
#define NUM_USB_BUFFERS 12
#define NUM_INTERFACE 2
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 4
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE 64
#define CDC_TX_SIZE 64
#define ENDPOINT2_CONFIG ENDPOINT_TRANSIMIT_ONLY
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_ONLY
#define ENDPOINT4_CONFIG ENDPOINT_TRANSIMIT_ONLY


/*Modified section in usb_desc.c*/
#endif
EP0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
0x00, 0x07, // bcdDevice
1, // iManufacturer
2, // iProduct
3, // iSerialNumber
1 // bNumConfigurations

modified.PNG
Modifications made in usb_desc.c and usb_desc.h reflected in Device Manager EXCEPT device description.

i've also tried to change it in usb_private.h

I've tried a bunch of combinations of the above methods as well (change it in usb_private.h AND increment bcdDevice, etc). perhaps theres some "magic" combination that someone has uncovered?

Thanks for the help guys!
 
Last edited:
Windows caches USB device info in the Windows Registry. Yes, that's a very silly design on Microsoft's part, since they have to read all the info every time the device is connected. They do love their Registry!

You have to either change the VID or PID or BCD version to get Windows to recognize it's not the same info it previously cached. Or there's probably some way to clean the old info from your machine. I'm not a Windows expert, so I can't help with that side.
 
Thanks for the quick reply!

I did actually change each of those values, and all 3 a few times. At least, I believe thats what i was changing in the desc_usb.h file
 
If you're looking for a customized name in the Windows Device Manager, you should use a INF with hardware ID matching. Hardware ID matching takes precedence over Compatible ID matching, but of course, only if you've signed you INF.

Windows 10 (tech previews) finally started including a Compatible ID match INF. That's good news for most of us. But if you want a custom name and you're using my files with Compatible ID, you'll almost certainly need to switch to Hardware ID when Windows 10 comes out.
 
hi,

i have been using teensy 3.1 for my project and im running it on windows7 . i wanted to change the device name which is being shown as "teensy usb serial" to a custom name for my project . i had read a few posts , where it was told to change bcd version number . so i had changed the bcd version number in usb_desc.c and also modified the name in usb_desc.h.

// **************************************************************
// USB Device
// **************************************************************

#define LSB(n) ((n) & 255)
#define MSB(n) (((n) >> 8) & 255)

// USB Device Descriptor. The USB host reads this first, to learn
// what type of device is connected.
static uint8_t device_descriptor[] = {
18, // bLength
1, // bDescriptorType
0x00, 0x02, // bcdUSB
#ifdef DEVICE_CLASS
DEVICE_CLASS, // bDeviceClass
#else
0,
#endif
#ifdef DEVICE_SUBCLASS
DEVICE_SUBCLASS, // bDeviceSubClass
#else
0,
#endif
#ifdef DEVICE_PROTOCOL
DEVICE_PROTOCOL, // bDeviceProtocol
#else
0,
#endif
EP0_SIZE, // bMaxPacketSize0
LSB(VENDOR_ID), MSB(VENDOR_ID), // idVendor
LSB(PRODUCT_ID), MSB(PRODUCT_ID), // idProduct
0x00, 0x02, // bcdDevice
1, // iManufacturer
2, // iProduct
3, // iSerialNumber
1 // bNumConfigurations
};

also changed the name in usb_private.h . i tried it many a times but doesnt seem to work . please let me know where is tat im going wrong and suggest me a solution
 
i wanted to change the device name which is being shown as "teensy usb serial" to a custom name for my project

For that, you'll need to make a custom INF file. When an INF file is used, Windows ignores the names from the hardware and shows the names from the INF file. The non-serial stuff shows the names from the USB descriptors, but for serial is different.

The good news is the INF Teensyduino installs uses "Compatible Id" matching, which is a lower priority than "Hardware Id". So you can make your own INF, which will override the one from Teensyduino. There are lots of examples of making a USB serial INF using Hardware Id matching, so I'm sure you can find them if you search. Hopefully this will at least give you the right terms to use for search...

With modern versions of Windows, you *must* sign your INF. Even if you reboot or use other tricks to get your unsigned INF installed, it will always have the absolute lowest matching priority if it's unsigned. To sign INF files, you use a utility from Microsoft's free WDK. You do not need to submit anything to WHQL. However, you do need a code signing certificate, which isn't free. That doesn't come from Microsoft. Usually the best prices are for Comodo through resellers.

You should probably also be aware the Windows 10 (probably) includes a Compatible-Id matching INF with generic naming. At least the early tech preview did. I'm getting a Windows 10 disc tomorrow, so until then I do not know what Microsoft actually shipped.
 
Also, if you search for stuff about signing drivers, you'll turn up a lot of stuff about "kernel mode" signatures for the binary executable code of drivers. A lot of the same terminology is used. The main thing you need to know is INF signing does not have the more stringent rules as kernel mode driver signing. Regular code signing certificates work. You don't need the more special ones for kernel mode driver signatures.
 
I need to change the midi device name of my teensy 3.0. I changed the lines inside the file usb_desc.h (the name and the device id). It works fine.
I noticed that the serial doesn't work anymore as soon as I change the device name. Is it normal? Is there a way I could keep the serial connection because it's very useful for debugging...
 
It should still work in arduino IDE.

It currently won't via visual micro but you can use visual micro/atmel studio and just open arduino IDE serial logger to view serial output.

Visual micro are aware of the situation - it's on the list.

Edit: sorry this might be a different issue you are reporting
 
Sorry, I wasn't clear.
I need to get the serial emulation monitor of Arduino working; which is not at the moment. That one is enough for me.
 
We're talking about the same thing it's just possibly different circumstances.

Are you using arduino IDE?
 
So to get my custom ini signed for windows10 i just need to buy the standard cert not this ev version?
 
So to get my custom ini signed for windows10 i just need to buy the standard cert not this ev version?

You need a cert specifically for code signing. The normal and ev certs for https on websites will not work.

For the best service with a low price, I'd recommend these guys.

http://codesigning.ksoftware.net/

Of course, you can spend more... so much more. If you click this links and follow a few others to get a price, I hope you're sitting down when you see the number!

https://www.symantec.com/code-signing/
 
Thanks for that :)

Yes i have seen the numbers and i was sitting down after! Hehe.

That sorta brings me to my next question :) Purchasing your own vid/pid I had a look at usb.org and dont want to spend 2k a year for 65k pids lol i just want 1 vid/pid for my product. Any advice on purchasing these is one off quantities.

Basically my end goal is to just plug my teensy based product into windows have it install my .ini without problem (or auto install from windows driver store? Or is this a paid service as well?)

Also from reading this thread paul mentions if we dont even offer a ini fike and a teensy is plugged into windows 10 it will just automatically be installed as a serial device no questions asked? Then we can just query the vid/pid to find its com number.




My current product / custom ini installs the device with a custom comport friendly name this is how i find which port its on. But windows 10 is not playing nice. So moving to vid/pid query might be a better move!

Thanks for your help :)
 
russdx - I'm not sure if PJRC published info on finding your Teensy - but the above liked TYQT is open source and he finds them in any natural state in that code - on WIN/IOS/Linux.
 
Hello there

I'm trying to use 2 Teensy 3.2 devices simultaneously and I'd like them to have different device names. I achieved that by using the code on the MIDI_Name example, and it works fine with just one device connected: each one has its own name.

But the moment I plug in the second one, the names change and both devices appear with the name of the last device plugged in.

Have anyone any idea about what am I doing wong?
 
Status
Not open for further replies.
Back
Top