CW312T-A35 and iCE40 are not working with CW Husky

Hello,

I have been working with the CW312T-A35 board, using both the CW Husky and CW313 support board. Recently, I attempted to test it using the PA_HW_CW312T-A35-Attacking_AES_on_an_FPGA example code. However, during the process, especially when trying to upload the bitstream to the FPGA, I encountered an error. To resolve this issue, I’ve already tried the following steps:

Reconnecting the device.
Updating the requirements.
Despite these efforts, I am still facing the same error, as shown in the attached image. Any suggestions on how to fix this would be greatly appreciated.

Error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[5], line 21
     17         fpga_id = '35t'
     19 # On the CW305, setting force=False only programs the FPGA if it is currently unprogrammed, whereas force=True programs the FPGA regardless.
     20 # This option isn't available on the CW312T_A35 or CW312T_ICE40.
---> 21 target = cw.target(scope, cw.targets.CW305, force=True, fpga_id=fpga_id, platform=platform)

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py:415, in target(scope, target_type, **kwargs)
    400 """Create a target object and connect to it.
    401 
    402 Args:
   (...)
    412     Connected target object specified by target_type.
    413 """
    414 rtn = target_type()
--> 415 rtn.con(scope, **kwargs)
    417 # need to check
    418 if type(rtn) in (targets.SimpleSerial, targets.SimpleSerial2) \
    419     and scope and scope._getNAEUSB().check_feature("SERIAL_200_BUFFER"):

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets\_base.py:65, in TargetTemplate.con(self, scope, **kwargs)
     63 try:
     64     self.connectStatus = True
---> 65     self._con(scope, **kwargs)
     66 except:
     67     self.dis()

TypeError: CW305._con() got an unexpected keyword argument 'platform'

If I remove the “platform=platform”, I am getting the this new error:

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
Cell In[6], line 21
     17         fpga_id = '35t'
     19 # On the CW305, setting force=False only programs the FPGA if it is currently unprogrammed, whereas force=True programs the FPGA regardless.
     20 # This option isn't available on the CW312T_A35 or CW312T_ICE40.
---> 21 target = cw.target(scope, cw.targets.CW305, force=True, fpga_id=fpga_id)

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py:415, in target(scope, target_type, **kwargs)
    400 """Create a target object and connect to it.
    401 
    402 Args:
   (...)
    412     Connected target object specified by target_type.
    413 """
    414 rtn = target_type()
--> 415 rtn.con(scope, **kwargs)
    417 # need to check
    418 if type(rtn) in (targets.SimpleSerial, targets.SimpleSerial2) \
    419     and scope and scope._getNAEUSB().check_feature("SERIAL_200_BUFFER"):

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets\_base.py:65, in TargetTemplate.con(self, scope, **kwargs)
     63 try:
     64     self.connectStatus = True
---> 65     self._con(scope, **kwargs)
     66 except:
     67     self.dis()

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets\CW305.py:299, in CW305._con(self, scope, bsfile, force, fpga_id, defines_files, slurp, prog_speed, hw_location, sn)
    284 def _con(self, scope=None, bsfile=None, force=False, fpga_id=None, defines_files=None, slurp=True, prog_speed=20E6, hw_location=None, sn=None):
    285     """Connect to CW305 board, and download bitstream.
    286 
    287     If the target has already been programmed it skips reprogramming
   (...)
    297         slurp (bool, optional): Whether or not to slurp the Verilog defines.
    298     """
--> 299     self._naeusb.con(idProduct=[0xC305], serial_number=sn, hw_location=hw_location)
    300     if not fpga_id is None:
    301         if fpga_id not in ('100t', '35t'):

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:695, in NAEUSB.con(self, idProduct, connect_to_first, serial_number, hw_location, **kwargs)
    690 def con(self, idProduct : Tuple[int]=(0xACE2,), connect_to_first : bool=False, 
    691     serial_number : Optional[str]=None, hw_location : Optional[Tuple[int, int]]=None, **kwargs) -> int:
    692     """
    693     Connect to device using default VID/PID
    694     """
--> 695     self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
    698     self.snum=self.usbtx.sn
    699     fwver = self.readFwVersion()

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:377, in NAEUSB_Backend.open(self, serial_number, idProduct, connect_to_first, hw_location)
    371 def open(self, serial_number : Optional[str]=None, idProduct : Optional[List[int]]=None, 
    372     connect_to_first : bool =False, hw_location : Optional[Tuple[int, int]]=None) -> Optional[usb1.USBDeviceHandle]:
    373     """
    374     Connect to device using default VID/PID
    375     """
--> 377     self.device = self.find(serial_number, idProduct, hw_location=hw_location)
    378     if connect_to_first == False:
    379         return None

File c:\users\t177h608_a\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py:344, in NAEUSB_Backend.find(self, serial_number, idProduct, hw_location)
    342 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
    343 if len(dev_list) == 0:
--> 344     raise OSError("Could not find ChipWhisperer. Is it connected?")
    346 # if more than one CW, we require a serial number
    347 if hw_location:

OSError: Could not find ChipWhisperer. Is it connected?

You need to use the chipwhisperer develop branch in order to get support for the new targets.

@jpthibault I have cloned the develop branch of chipwhisperer, but got the same error. Can you please help me with this?

You need to restart your notebook in order for the updated Python code to get pulled in.

Then, check that this points to your chipwhisperer develop repository:

import chipwhisperer as cw
cw.__file__

Then, you should now see the previously missing platform argument when you run this:

import chipwhisperer.capture.targets.CW305 as cw305
cw305._con?

If you don’t, then either Python is not importing the correct chipwhisperer package, or perhaps your chipwhisperer develop repository is not up to date. Make sure you follow the manual installation instructions here for Windows or here for Linux.

Thank you. It worked!