Discussion:
[OpenOCD-devel] ST-link v2 serial number
Jens Bauer
2016-08-19 19:26:47 UTC
Permalink
Hi all.

As I have many ST-link v2 connected at the same time, I decided to see if I could select the one I wish to use by using the serial number.

So today I opened the file ...
/usr/local/share/openocd/scripts/interface/stlink-v2.cfg
... and read that "ST-LINK/V2 devices seem to have serial numbers with unreadable characters"

I've noticed that earlier. But as I've made a program, which lists all USB devices, I use this program for listing the device information (in addition I use system_profiler and ioreg -p IOUSB -l).

My program lists the following information:

Name: STM32 STLink
VID: 0483
PID: 3748
Mfg: STMicroelectronics
Product: STM32 STLink
Serial: WÿsQˆQT0Eg
Release: 1.00

But I noticed that I at some point connected a STLink v2 and I saw the serial number "000000000001"
-So I tried disconnecting and re-connecting the device.
And suddenly, yes, it shows up as '000000000001', the same one that showed up as 'WÿsQˆQT0Eg' earlier!
All 3 utilities agree on the serial numbers are erratic.

So in fact it seems that ST intended to have a 12-digit serial number, but somehow a periodic error occurs (uninitialized variable perhaps).

-Rémi, can I ask you to forward this e-mail to the ST-Link v2 firmware developers, so they will have a chance of finding the error ?


Love
Jens

------------------------------------------------------------------------------
Paul Fertser
2016-08-19 20:19:09 UTC
Permalink
Hey Jens :)
Post by Jens Bauer
-Rémi, can I ask you to forward this e-mail to the ST-Link v2
-firmware developers, so they will have a chance of finding the
-error ?
AFAIR, this was reported to be fixed in the latest firmware version
but it doesn't increment the version number, so the stlink update
utility will show that you have the same version but you need to
update anyway. Then you'll get the consistent serial numbers. The only
reliable way to specify them currently is to use

openocd -d3 | hexdump -C

to obtain the specific number. However, there's a patch:
http://openocd.zylin.com/#/c/2343/

HTH
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:***@gmail.com

------------------------------------------------------------------------------
Jens Bauer
2016-08-19 21:26:49 UTC
Permalink
Hi Paul.

Thank you for the quick reply. :)
-I guess I am a few years late on this one (so Rémi, you don't need to forward the previous email anyway). :D

Updating firmware on the ST-Link v2 is a bit difficult for me; I'd probably have to find a PC running Windows (perhaps on the public library).


Love
Jens
Post by Paul Fertser
Hey Jens :)
Post by Jens Bauer
-Rémi, can I ask you to forward this e-mail to the ST-Link v2
-firmware developers, so they will have a chance of finding the
-error ?
AFAIR, this was reported to be fixed in the latest firmware version
but it doesn't increment the version number, so the stlink update
utility will show that you have the same version but you need to
update anyway. Then you'll get the consistent serial numbers. The only
reliable way to specify them currently is to use
openocd -d3 | hexdump -C
http://openocd.zylin.com/#/c/2343/
HTH
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
------------------------------------------------------------------------------
Antonio Borneo
2016-08-19 22:05:42 UTC
Permalink
Post by Jens Bauer
Hi Paul.
Thank you for the quick reply. :)
-I guess I am a few years late on this one (so Rémi, you don't need to forward the previous email anyway). :D
Updating firmware on the ST-Link v2 is a bit difficult for me; I'd probably have to find a PC running Windows (perhaps on the public library).
Hi Jens,

today the tools to upgrade the FW of ST-Link run also on Mac and Linux.
You just have to choose the right tool depending on ST-Link model (V2 or V2-1)
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link005.html
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link007.html

Regards,
Antonio

------------------------------------------------------------------------------
Jens Bauer
2016-08-19 22:41:16 UTC
Permalink
Hi Antonio.

Thank you for the information on the tools.
My Mac os a PowerMac G5 (all my Macs are PowerPC based).
Do the tools run on such Macs as well ?


Love
Jens
Post by Antonio Borneo
Post by Jens Bauer
Hi Paul.
Thank you for the quick reply. :)
-I guess I am a few years late on this one (so Rémi, you don't need
to forward the previous email anyway). :D
Updating firmware on the ST-Link v2 is a bit difficult for me; I'd
probably have to find a PC running Windows (perhaps on the public
library).
Hi Jens,
today the tools to upgrade the FW of ST-Link run also on Mac and Linux.
You just have to choose the right tool depending on ST-Link model (V2 or V2-1)
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link005.html
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link007.html
Regards,
Antonio
------------------------------------------------------------------------------
Antonio Borneo
2016-08-19 22:54:50 UTC
Permalink
Post by Jens Bauer
Hi Antonio.
Thank you for the information on the tools.
My Mac os a PowerMac G5 (all my Macs are PowerPC based).
Do the tools run on such Macs as well ?
I only tested it on Linux, so cannot guarantee it on Mac.
But it is a Java application. If you have installed the right jvm it
should work.
In one document in the webpage I read "The application requires the
Java Runtime Environment 7u51 (or more recent) ..."

Antonio
Post by Jens Bauer
Love
Jens
Post by Antonio Borneo
Post by Jens Bauer
Hi Paul.
Thank you for the quick reply. :)
-I guess I am a few years late on this one (so Rémi, you don't need
to forward the previous email anyway). :D
Updating firmware on the ST-Link v2 is a bit difficult for me; I'd
probably have to find a PC running Windows (perhaps on the public
library).
Hi Jens,
today the tools to upgrade the FW of ST-Link run also on Mac and Linux.
You just have to choose the right tool depending on ST-Link model (V2 or V2-1)
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link005.html
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link007.html
Regards,
Antonio
------------------------------------------------------------------------------
Jens Bauer
2016-08-20 00:02:16 UTC
Permalink
Hi Antonio.

I finally found a browser I could use with st.com ...
After downloading the upgrade tool, I found out that I've tried it before (with an earlier version).
I get some errors on the console, so currently, it does not run "asis" on the PowerPC with Mac OS X 10.5.8.

It seems I'll need to try out the public library tomorrow.


Love
Jens
Post by Antonio Borneo
Post by Jens Bauer
Hi Antonio.
Thank you for the information on the tools.
My Mac os a PowerMac G5 (all my Macs are PowerPC based).
Do the tools run on such Macs as well ?
I only tested it on Linux, so cannot guarantee it on Mac.
But it is a Java application. If you have installed the right jvm it
should work.
In one document in the webpage I read "The application requires the
Java Runtime Environment 7u51 (or more recent) ..."
Antonio
Post by Jens Bauer
Love
Jens
Post by Antonio Borneo
Post by Jens Bauer
Hi Paul.
Thank you for the quick reply. :)
-I guess I am a few years late on this one (so Rémi, you don't need
to forward the previous email anyway). :D
Updating firmware on the ST-Link v2 is a bit difficult for me; I'd
probably have to find a PC running Windows (perhaps on the public
library).
Hi Jens,
today the tools to upgrade the FW of ST-Link run also on Mac and Linux.
You just have to choose the right tool depending on ST-Link model (V2 or V2-1)
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link005.html
http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link007.html
Regards,
Antonio
------------------------------------------------------------------------------
Loading...