Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed st-info --probe mechanism #918

Merged
merged 7 commits into from Apr 10, 2020

Conversation

grevaillot
Copy link
Collaborator

Hi,

here's a small patchset to fixup st-info probe mecanism and lower layers.

  • handle stlink v1
  • fetch serial info for all stlinks
  • return proper number of functionnal and connectable stlinks
  • fix probe fail when one stlink v1 and more recent one are connected
  • add macros for usb pid filtering.

This has been tested with a couple of devices connected (v1, v2, v2.1 and v3). Note that it seems that all v1 have the same serial, so, i guess that selecting them will be complicated - there's apparently some kind of hidden env variable filter mecanism based on usb addr in addition to the --serial parameter, but i've not tested it.

Found 3 stlink programmers
serial: 493f6c06483f53491743073f
hla-serial: "\x49\x3f\x6c\x06\x48\x3f\x53\x49\x17\x43\x07\x3f"
flash: 32768 (pagesize: 1024)
sram: 6144
chipid: 0x0445
descr: F04x
serial: 303033413030343233313337353130413339333833353338
hla-serial: "\x30\x30\x33\x41\x30\x30\x34\x32\x33\x31\x33\x37\x35\x31\x30\x41\x33\x39\x33\x38\x33\x35\x33\x38"
flash: 524288 (pagesize: 4096)
sram: 98304
chipid: 0x0469
descr: G4 Category-3
serial: 303030303030303030303031
hla-serial: "\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x30\x31"
flash: 131072 (pagesize: 1024)
sram: 8192
chipid: 0x0420
descr: F1xx Value Line

ease v1/v2/v2.1/v3 identification and supported devices filtering
actually open all counted devices - the two vid check need to be aligned.
also now display if some st device has been skipped.
…one_ probe failed.

we return count and list of successfully probed devices, no need to free
everything if some libusb call of the last probe attempt failed.
…cted.

serial match was not done for v1 device, resulting in attempting to open it systematically,
leading to some libusb device claim call failure.
Lookup device serial for all chips, compare it if needed, and continue.
@Nightwalker-87 Nightwalker-87 self-requested a review April 10, 2020 15:46
@grevaillot
Copy link
Collaborator Author

This should help #679.

@Nightwalker-87 Nightwalker-87 added this to the v1.6.1 milestone Apr 10, 2020
@Nightwalker-87 Nightwalker-87 added this to In progress in Release v1.6.1 via automation Apr 10, 2020
@Nightwalker-87 Nightwalker-87 linked an issue Apr 10, 2020 that may be closed by this pull request
@Nightwalker-87 Nightwalker-87 changed the title fix probe mecanism Fixed st-info --probe mechanism Apr 10, 2020
Release v1.6.1 automation moved this from In progress to Reviewer approved Apr 10, 2020
@Nightwalker-87 Nightwalker-87 merged commit bf39a19 into stlink-org:develop Apr 10, 2020
Release v1.6.1 automation moved this from Reviewer approved to Done Apr 10, 2020
@Nightwalker-87
Copy link
Member

Thank you very much for fixing this!

@grevaillot grevaillot deleted the to_merge/fixed_probe branch April 21, 2020 15:04
@stlink-org stlink-org locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Cannot connect to STM32VL under Linux
2 participants