cancel
Showing results for 
Search instead for 
Did you mean: 

How to set USB serial number attribute of virtual com port (stm32f4)

Sietse
Associate III
Posted on September 05, 2017 at 15:17

Hello,

I am working with stm32f4 discovery and linux systems.

We have a larger number of discovery boards that are interfaced via USB, and want to be able to connect to each one uniquely. I normally do that by using the attribute 'serial' that USB can give me, and I use the number in an udev-rule to get a unique devicename in /dev. An example of such a rule is:

SUBSYSTEM=='tty', ATTRS{idVendor}=='0483', ATTRS{idProduct}=='5740', ATTRS{serial}=='00000000001A', SYMLINK+='VHP100'

The problem is that this serial number is NOT fixed. It sometimes changes after a reboot.  I have never seen this with other devices.

The question is, how can I fix/set this number? A cannot find anything in the CubeMX stuff about this.

UPDATE: The fact that the number changes suggests that it resides in software. Does anyone know where the value is set?

Thanks in advance,

      Sietse

#stm32f4-usb-virtual-com-port-serial-attribute
1 ACCEPTED SOLUTION

Accepted Solutions
Sietse
Associate III
Posted on September 19, 2017 at 09:45

Via another question I found out that the serial number is fixed and can be set in the file Src/usbd_desc.c

View solution in original post

1 REPLY 1
Sietse
Associate III
Posted on September 19, 2017 at 09:45

Via another question I found out that the serial number is fixed and can be set in the file Src/usbd_desc.c