cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 USB VCP

Bucky
Associate II
Posted on October 11, 2017 at 13:27

Hi guys,

I'm using an STM32F446 micro-controller with USB CDC stack configured as VCP.

Each time that i connect a device the operating system (Win 7) assign a new COM port number to the connected device.

I know it's a correct behaviour but I'd like to avoid this.

Is it possibile by modifying stmcdc.inf file or OS properties? Other ideas?

Thanks in advance

Stewie

3 REPLIES 3
Tuttle.Darrell
Associate II
Posted on October 11, 2017 at 17:29

You need to provide a unique USB serial number for each device. I use the CPU UID (unique ID) for this. Windows will see this and apply a consistent COM port number.

Bucky
Associate II
Posted on October 12, 2017 at 09:10

Hi Tut,

thanks for your answer.

How is possible to provide an unique USB serial number?

In term of firmware code the devices are exactly the same. Is something that i have to modify at *.inf level?

Let me know

Thanks

Stewie

Posted on October 12, 2017 at 09:26

How is possible to provide an unique USB serial number?

You provide it as an index from the Device descriptor to a unique String descriptor.

0690X00000608aQQAQ.png

If you are using some ''library'', find the place where the descriptors are defined, find how the Device descriptor is defined, find this index within it, find where does it point and modify the string. If it's zero, find out where the String descriptors are defined, add one and then add the appropriate index. You need different string for each hardware. The ''real stuff'' is to generate the string on the fly e.g. from the STM32's UniqueID, in that way you'll have the same firmware.

JW