Having problems setting up the ChipWhisperer Nano

Hi I just got myself a ChipWhisperer but have unfortunately not been able to set it up. I have tried setting it up on two different linux distributions and get the same error mesage(linux and ubuntu).
This is the message i get ??

USBErrorBusy                              Traceback (most recent call last)
Input In [6], in <module>
      1 import chipwhisperer as cw
----> 2 scope = cw.scope()

File ~/SCA/chipwhisperer/software/chipwhisperer/__init__.py:338, in scope(scope_type, name, sn, idProduct, bitstream, force, prog_speed, **kwargs)
    336 rtn : scopes.ScopeTypes = scope_type()
    337 try:
--> 338     rtn.con(**kwargs)
    339 except IOError:
    340     scope_logger.error("ChipWhisperer error state detected. Resetting and retrying connection...")

File ~/SCA/chipwhisperer/software/chipwhisperer/capture/scopes/cwnano.py:628, in CWNano.con(self, sn, **kwargs)
    626             if "idProduct" in kwargs:
    627                 del kwargs['idProduct']
--> 628             found_id = self._cwusb.con(idProduct=[0xACE0], serial_number=sn, **kwargs)
    629         except (IOError, ValueError) as e:
    630             raise Warning("Could not connect to cwnano. It may have been disconnected,\
    631 is in an error state, or is being used by another tool.") from e

File ~/SCA/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py:665, in NAEUSB.con(self, idProduct, connect_to_first, serial_number, hw_location, **kwargs)
    660 def con(self, idProduct : Tuple[int]=(0xACE2,), connect_to_first : bool=False, 
    661     serial_number : Optional[str]=None, hw_location : Optional[Tuple[int, int]]=None, **kwargs) -> int:
    662     """
    663     Connect to device using default VID/PID
    664     """
--> 665     self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
    668     self.snum=self.usbtx.sn
    669     fwver = self.readFwVersion()

File ~/SCA/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py:376, in NAEUSB_Backend.open(self, serial_number, idProduct, connect_to_first, hw_location)
    373 self._usbdev = self.handle
    375 # claim bulk interface, may not be necessary?
--> 376 self.handle.claimInterface(0)
    378 self.sn = self.handle.getSerialNumber()
    379 self.pid = self.device.getProductID()

File ~/.local/lib/python3.10/site-packages/usb1/__init__.py:1146, in USBDeviceHandle.claimInterface(self, interface)
   1136 def claimInterface(self, interface):
   1137     """
   1138     Claim (= get exclusive access to) given interface number. Required to
   1139     receive/send data.
   (...)
   1144         # handle.releaseInterface(0) gets automatically called
   1145     """
-> 1146     mayRaiseUSBError(
   1147         libusb1.libusb_claim_interface(self.__handle, interface),
   1148     )
   1149     return _ReleaseInterface(self, interface)

File ~/.local/lib/python3.10/site-packages/usb1/__init__.py:127, in mayRaiseUSBError(value, __raiseUSBError)
    121 def mayRaiseUSBError(
    122         value,
    123         # Avoid globals lookup on call to work during interpreter shutdown.
    124         __raiseUSBError=raiseUSBError,
    125     ):
    126     if value < 0:
--> 127         __raiseUSBError(value)
    128     return value

File ~/.local/lib/python3.10/site-packages/usb1/__init__.py:119, in raiseUSBError(value, __STATUS_TO_EXCEPTION_DICT, __USBError)
    113 def raiseUSBError(
    114         value,
    115         # Avoid globals lookup on call to work during interpreter shutdown.
    116         __STATUS_TO_EXCEPTION_DICT=STATUS_TO_EXCEPTION_DICT,
    117         __USBError=USBError,
    118     ): # pylint: disable=dangerous-default-value
--> 119     raise __STATUS_TO_EXCEPTION_DICT.get(value, __USBError)(value)

USBErrorBusy: LIBUSB_ERROR_BUSY [-6]

I found using the Virtual Box to be the easiest way to get the environment to work. Once you start up for the first time log in a user vagrant and password vagrant. Once logged in you be asked to provide a password for Jupyter. After that you don’t need to log in. Once that is up and running then plug your Nano in and it will get assigned automatically to the VM. From your host goto http://127.0.0.1:8888 will get you to the Jupyter

I get the exact same error message using the virtual environment through vagrant:(

This is the output of running lsusb -v

Bus 001 Device 002: ID 2b3e:ace0  
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x2b3e 
  idProduct          0xace0 
  bcdDevice            9.00
  iManufacturer           1 NewAE Technology Inc.
  iProduct                2 ChipWhisperer Nano
  iSerial                 3 533331003257394c3530323037313037
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           98
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              400mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         1
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       2 Abstract (modem)
      bFunctionProtocol       1 AT-commands (v.25ter)
      iFunction               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0 
      CDC Header:
        bcdCDC               1.10
      CDC ACM:
        bmCapabilities       0x02
          line coding and serial state
      CDC Union:
        bMasterInterface        1
        bSlaveInterface         2 
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          2
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval              16
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x86  EP 6 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x07  EP 7 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength           33
  bNumDeviceCaps          1
  ** UNRECOGNIZED:  1c 10 05 00 df 60 dd d8 89 45 c7 4c 9c d2 65 9d 9e 64 8a 9f 00 00 03 06 4a 01 01 00
Device Status:     0x0000
  (Bus Powered)

can you provide more information about what you are trying to do? Like what code are you running?

I do see this error if I have a scope object already assigned and I try to rerun a block. What helps is to unplug the device and plug it back in. I suspect that is not going to assist you.

what does does dmesg show?

here is the output of running dmesg → https://termbin.com/d12c
And yes i get this error when i try to connect to the chipwhisperer through

scope = cw.scope()

Hm, it looks like the device is reenumerating when you try to connect. If you try Unable to communicate with found ChipWhisperer - #9 by Alex_Dewar, does this fix this?

Alex

I have tried restarting it like this, doing the exact same thing as you described but still the exact same error message. I’m having trouble figuring out exactly what the error is

The fact that it’s failing on the interface claim seems to indicate that something else has claimed it first. I’ve seen references elsewhere that you might be able to fix this by releasing the interface before you claim it. Can you try editing chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py and adding self.handle.releaseInterface(0) directly above self.handle.claimInterface(0) (should be line 376).

If that doesn’t work try removing both calls.

Alex