USB error Windows 10 installation

Hello,

I have ChipWhisperer-Lite working on Ubuntu in a VM, but I can not get it working with the Windows installation. The ChipWhisperer is found but scope.default_setup() always results in ‘USB error: [Errno 32] Pipe error’.

What could be causing this, and how do I fix it?

Thanks in advance.

I have included the output here below:
INFO: Found ChipWhisperer😍


USBError Traceback (most recent call last)
in
25 import time
26 time.sleep(0.05)
—> 27 scope.default_setup()
28 def reset_target(scope):
29 if PLATFORM == “CW303” or PLATFORM == “CWLITEXMEGA”:

…\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\scopes\OpenADC.py in default_setup(self)
165
166 self.clock.adc_src = “clkgen_x4”
–> 167 self.io.cdc_settings = 0
168
169 count = 0

…\cw\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py in setattr(self, name, value)
349
350 def setattr(self, name, value):
–> 351 if hasattr(self, ‘_new_attributes_disabled’) and self._new_attributes_disabled and not hasattr(self, name): # would this create a new attribute?
352 raise AttributeError(“Attempt to set unknown attribute in %s”%self.class, name)
353 super(DisableNewAttr, self).setattr(name, value)

…\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\scopes\cwhardware\ChipWhispererExtra.py in cdc_settings(self)
210 if ver < ‘0.30’:
211 return None
–> 212 return self.cwe.oa.serial.get_cdc_settings()
213
214 @cdc_settings.setter

…\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_cdc_settings(self)
670
671 def get_cdc_settings(self):
–> 672 return self.usbtx.readCtrl(self.CMD_CDC_SETTINGS_EN, dlen=2)
673
674 def set_cdc_settings(self, port=[1, 1]):

…\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in readCtrl(self, cmd, value, dlen)
501 “”"
502 # Vendor-specific, IN, interface control transfer
–> 503 return self.usbdev().ctrl_transfer(0xC1, cmd, value, 0, dlen, timeout=self._timeout)
504
505 def cmdReadMem(self, addr, dlen):

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\core.py in ctrl_transfer(self, bmRequestType, bRequest, wValue, wIndex, data_or_wLength, timeout)
1077 wIndex,
1078 buff,
-> 1079 self.__get_timeout(timeout))
1080
1081 if isinstance(data_or_wLength, array.array) \

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\backend\libusb1.py in ctrl_transfer(self, dev_handle, bmRequestType, bRequest, wValue, wIndex, data, timeout)
899 cast(addr, POINTER(c_ubyte)),
900 length,
–> 901 timeout))
902
903 return ret

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\backend\libusb1.py in _check(ret)
602 raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
603 else:
–> 604 raise USBError(_strerror(ret), ret, _libusb_errno[ret])
605
606 return ret

USBError: [Errno 32] Pipe error

Hi,

Do you know what firmware version your ChipWhisperer is on (scope.fw_version)? CDC serial support and control was added in firmware 0.30, so if your firmware is older than that, your ChipWhisperer won’t support that command. We do check if your firmware is new enough (210 if ver < ‘0.30’:), but it’s possible this check could be failing for some reason.

Alex

scope.fw_version = {‘major’: 0, ‘minor’: 50, ‘debug’: 0}

Hm, so what I think is happening is that firmware 0.50 sends back 4 bytes for that CDC command, but older firmware only sent back 2 bytes. Both firmware versions also do a check on the requested length to make sure it matches and will reject the request if it doesn’t. This release corresponds to the 2 byte version, so when the python code only requests 2 bytes, the ChipWhisperer rejects the request. Your VM probably has the newer ChipWhisperer code that requests 4 bytes instead.

I’ll make an update to the firmware to not reject requests of an incorrect length, but in the meantime, you can modify line 672 of chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py to return self.usbtx.readCtrl(self.CMD_CDC_SETTINGS_EN, dlen=4). Alternatively, you can reflash your ChipWhisperer with the firmware that comes with the Windows release you have.

I’ve made a github issue to track this (https://github.com/newaetech/chipwhisperer/issues/370) and will report back when I’ve built new firmware that fixes this.

Alex

I modified the line in naueusb.py, and it works now.

Thank you for your help!