Stlink: [feature] Programmer serial should be displayed when no target is connected

Created on 15 Jun 2016  ·  7Comments  ·  Source: stlink-org/stlink

When there is currently no target connected the programmer is found but no serial is displayed. This is not handy when we extract the serial number (and OpenOCD hla_serial) when the target is powered on.

bufixed codfeature-request componenst-info programmestlinkv2-clone staturesolved

All 7 comments

@grevaillot: You just won this ticket, because I have found that your commit 804c38ead8aef3e4a1640a82a9b9c01f4f60eed1 somehow seems to address the issue above (per accident?) I find my STlink-v2 programmer to behave differently since (exactly) this commit. I don't know really what causes this change.

Here is the output of st-info --probe if no device is attached to the programmer:

Before:

Found 1 stlink programmers

Afterwards:

Found 1 stlink programmers
 serial:     3f76050132124647524b4e00
 hla-serial: "\x3f\x76\x05\x01\x32\x12\x46\x47\x52\x4b\x4e\x00"
 flash:      0 (pagesize: 0)
 sram:       0
 chipid:     0x0000
 descr:      unknown device

I don't really understand why this is the case.
However, as you are the author, it just makes sense to let you have a look at this.

I was not aware of that ticket, but yes, this is intended. I've got a couple of fixes for st-flash and gdb server to push to usb probe returning some st-link info with no target connected, i'll tag them with that ticket number.

hmm, the commit you referenced is not the good one, it was fixed in the probe rework patchset

@grevaillot I don't really know what causes the observed change there then. Maybe it is only a partial fix that leads to the change with this device or only a few others as seen from the code side, but is not a complete fix that addresses all devices by then - no clue on that yet. I'll try my second programmer with this commit as well (before and after). They are both CKS32F103C8T6 devices.

Here is the output of st-info --probe with commit 804c38ead8aef3e4a1640a82a9b9c01f4f60eed1 for the second programmer, which appears to be the same result:

Found 1 stlink programmers
 serial:     3f70050132124647524b4e00
 hla-serial: "\x3f\x70\x05\x01\x32\x12\x46\x47\x52\x4b\x4e\x00"
 flash:      0 (pagesize: 0)
 sram:       0
 chipid:     0x0000
 descr:      unknown device

while the previous commit 46bf0abf77cca47133d3839460cc7679e0f78714 returns:

Found 1 stlink programmers

Still wondering why...

sorry, got lost in my tree, let's sum up:

an intermediary commit the probe rework stuff could allow to get some stlink with not target connected to show as "found 1 stlink programmers" with no serial. This was an issue, probe was returning the number of stlink found instead of the number of stlink probed.

in no way 804c38ead8aef3e4a1640a82a9b9c01f4f60eed1 can change probe behaviour, i would suspect some local not-so-clean rebuild and test issue :)

my PR https://github.com/stlink-org/stlink/pull/933 should close that issue.

BTW, i think that --probe call should maybe display cpuid. This one should never be null and would help new chip support / bug report. but that's an other issue.

@grevaillot: You are right it must have been a local not-so-clean rebuild: By now I figured out that my findings derive from the changes introduced by the older manual merge-commit aad5cf1901f467914a2efe855c0caff7fdf99048, and thus none of yours. Also refer to #863 which derives from the same branch. So we should stay with what you mentioned before. However this explains the observed behaviour.

Was this page helpful?
0 / 5 - 0 ratings