Thanks to visit codestin.com
Credit goes to github.com

Skip to content

st-util should detect when USB commands fail #525

@galexander1

Description

@galexander1

I run st-util as a long-running daemon to interface with a sensor monitoring project. About once a month, the USB spontaneously resets, and then strace on st-util shows it is repeatedly failing:

ioctl(9, USBDEVFS_SUBMITURB, 0x8e35bd0) = -1 ENODEV (No such device)

And, for example, 'm' (gdb remote read memory) commands silently fail and simply return stale data that happens to sit in a buffer.

I haven't investigated in detail yet but my assumption is that libusb is returning an error code that gets lost at some point.

For my purposes, it would be most convenient if st-util were simply to re-connect to the USB, but I imagine other people would find that behavior kind of objectionable (state would change without gdb necessarily being informed). So I figure the proper answer is for st-util to simply terminate when the USB device goes away. (comments?)

So I will be submitting a patch "soon" to achieve that effect.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions