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

On windows, first glasgow command after plug-in errors, second one works #239

Closed
0x53A opened this issue Dec 3, 2020 · 3 comments · Fixed by #362
Closed

On windows, first glasgow command after plug-in errors, second one works #239

0x53A opened this issue Dec 3, 2020 · 3 comments · Fixed by #362
Labels
software Component: software

Comments

@0x53A
Copy link
Contributor

0x53A commented Dec 3, 2020

If I plug my glasgow in the first command errors out:

  1. plug in
  2. run glasgow list (and I get a bling from windows as if a device was connected)
C:\Users\lr>glasgow list
I: glasgow.device.hardware: found revC1 device with API level 0 (supported API level is 1)
Traceback (most recent call last):
  File "C:\Users\lr\AppData\Local\Programs\Python\Python39\Scripts\glasgow-script.py", line 33, in <module>
    sys.exit(load_entry_point('glasgow', 'console_scripts', 'glasgow')())
  File "c:\glasgow\repo\glasgow\software\glasgow\cli.py", line 856, in main
    exit(loop.run_until_complete(_main()))
  File "c:\users\lr\appdata\local\programs\python\python39\lib\asyncio\base_events.py", line 642, in run_until_complete
    return future.result()
  File "c:\glasgow\repo\glasgow\software\glasgow\cli.py", line 835, in _main
    for serial in sorted(GlasgowHardwareDevice.enumerate_serials()):
  File "c:\glasgow\repo\glasgow\software\glasgow\device\hardware.py", line 174, in enumerate_serials
    devices = cls._enumerate_devices(usb_context)
  File "c:\glasgow\repo\glasgow\software\glasgow\device\hardware.py", line 107, in _enumerate_devices
    handle = device.open()
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 2153, in open
    mayRaiseUSBError(libusb1.libusb_open(self.device_p, byref(handle)))
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 127, in mayRaiseUSBError
    __raiseUSBError(value)
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 119, in raiseUSBError
    raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)
usb1.USBErrorNoDevice: LIBUSB_ERROR_NO_DEVICE [-4]
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
Exception ignored in: <function USBDevice.__del__ at 0x000001EE1FC8FF70>
Traceback (most recent call last):
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1897, in __del__
  File "c:\users\lr\appdata\local\programs\python\python39\lib\site-packages\libusb1-1.8.1-py3.9-win-amd64.egg\usb1\__init__.py", line 1909, in close
OSError: exception: access violation writing 0x0000000000000024
  1. run glasgow list again:
C:\Users\lr>glasgow list
C1-20200924T010855Z

Notes: the usb driver has been a bit finicky and I clicked buttons in Zardig without really understanding what they do, apparently I currently have libusbk.

image

@whitequark whitequark added the software Component: software label Dec 3, 2020
@whitequark
Copy link
Member

There's a timeout in the enumeration code which probably needs increasing, but it's at 5 seconds already and I'm somewhat surprised that isn't enough. If it is increased significantly then we should do this once libusb hotplug lands on Windows (libusb/libusb#86).

@0x53A
Copy link
Contributor Author

0x53A commented Dec 13, 2020

After glasgow flash this seems to happen less often.
It still errors out if I execute a glasgow command immediatly after plugging it in, but if I plug it in and wait 10 seconds, it works.

Maybe I: glasgow.device.hardware: found revC1 device with API level 0 (supported API level is 1) could be extended with that information?

[...] (supported API level is 1, run 'glasgow flash' to update your device)

@whitequark
Copy link
Member

I think it would be better to fix the hotplug issue, or perhaps do both.

@whitequark whitequark reopened this Dec 13, 2020
@attie attie closed this as completed in #362 Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software Component: software
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants