-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Usb error more informative to user. Refactored vartypes of device's serial. #559
Conversation
* Refactored declaration of device's serial, muilttypes casted to uint8_t[STLINK_SERIAL_SIZE]. * Added search by env STLINK_SERIAL. * Reusage serial parsing code - stlink_parse_serial (outbuf-unsafe) changes in tools/flash_opts.c, gdbserver/gdb-server.c, usb.c (env)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, review the last changes.
I'm closing this PR as it is not 100% what we want because there is a mixture of hex/binary serial numbers and needs to be resolved in a generic way by writing a hex2bin/bin2hex implementation or using a existing one (e.g https://raw.githubusercontent.com/xor-gate/stlink2/master/src/utils/hexstr.c). |
@xor-gate, got it. Could you, please, take a look for branch https://github.com/theg4sh/stlink/tree/libusb_minimize Also, I found that all usb devices walked by 3 times per tool run, e.g. 'st-info --probe', so, did change regarding this - in branch stlink devices initialized once and then used prepared pointer to get next stlink device. In other hand, devices iterated for both versions - v1 and v2. I guess, it could be good for DRY, but stlinkv1 uses similar, but not the same backend callbacks. |
Looks good why so many info is necessary if you normalize to just a string (ascii, or asciihex). Directly converting inline after probe would be more friendly from API point of view.
|
A little change to inform user about problems during device search or open.