Open gicking opened 3 years ago
On the other hand, VID and PID are permant. AFAIK the "Device" number can change if you unplug and replug the device.
that is correct. But as said I cannot address individual STM8S Discovery boards as they have the same VID and PID. The device number from lsusb
was just a thought. Maybe there is a more persistent, unique USB identifier...?
I wonder if there is an ST-Link-specific identifier that we could use? Maybe the STM32 in it has a serial number that can be read out?
That would be great! I searched the web today and this seems to be a viable option. However, I didn't find a C way to do this, all references were for OpenOCD configuration.
Since linusb -v can display the serial number, then I think stm8flash should be able to get it through libusb.
any chance some of my pull requests will get merged upstream?
I'm in France for a few days, and have only an STM8A-Discovery here. When I'm back in Germany, assuming I'll find some time, I'll have a look at the pull requests again (and check that multiboard stuff by with multiple ones attached). I put it on my todo list for end of next week.
I also encountered the problem with multiple "303030303030303030303031" serial numbers. However, I only see that number after having used stm8flash once with that programmer. On the first invokation of stm8flash after plugging in an ST-Link/V2, I see different numbers.
In other places it was reported that the "303030303030303030303031" serial numbers after first use are an ST-Link/v2 firmware bug, and that updating the ST-Link/v2 to the latest firmware version will fix it. I haven't tested that yet myself.
I need to reflash multiple STM8S Discovery boards within the same circuit. I expected that I can select the respective board via -S option. But both STLink are shown with the same serial number (see below), so -S option has no other effect than avoiding the warning. Specifically, even with -S option (and same serial number), "Programmer 1" is always used.
I understand from here that the "-S" option uses USB vendor and procuct IDs to create a serial number. Unfortunately these are not unique if identical programmers are used. How about to also include the "Device" number from lsusb (see below). Apparently this is unique, even if VID and PID are identical