SiLab-Bonn / basil

A data acquisition framework in Python and Verilog.
BSD 3-Clause "New" or "Revised" License
40 stars 29 forks source link

pyserial not able to reinitialize MIO1.04 after first execution #204

Open dschuechter opened 1 year ago

dschuechter commented 1 year ago

If I rerun a script that initializes the MIO card 1.04 the error pyvisa.errors.VisaIOError: VI_ERROR_RSRC_NFOUND (-1073807343): Insufficient location information or the requested device or resource is not present in the system. occurs.

This error will stay until the MIO is resetted. A workaround is to reset the USB device whenever the MIO gets initialized. This can be done by:

from usb.core import find as finddev
class MIO(Dut):
    dev = finddev(idVendor=0x5312, idProduct=0x0200)
    dev.reset()
  ...

Other attempts like closing the device after the script finished did not work.

A real world example is given here.

This problem might be due to the ongoing development of basil and deprecation of this legacy hardware or missing backwards compatibility checks.