Scope = cw.scope() command is not running with CW305

Hello,
I just received my ChipWhisperer-Lite and the target board: CW305. I am using Windows 10 and I installed ChipWhisperer 5.5 directly (no VM). The USB driver of CW305 was automatically installed. However, I have installed the USB driver for ChipWhisperer-Lite (through device manager). For FPGA is XC7A100T: the M0M1M2 switch is “111”, the led light situation is following: on cw305, the led8(green) is on, the led1(red) is flashing, and the led FPGA_DONE-ON=Unprog(red) is on;
For CW-lite: blue (continuous blinking blue light) and others are off.

I am having great difficulty trying to program the CW305 target board. The scope = cw.scope() command is not working. Did I miss some installation/operation steps so it doesn’t work?

I believe this based upon running the following commands:

import chipwhisperer as cw
scope = cw.scope()

giving the error: chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py", line 354, in open raise OSError(“Failed to find USB device with S/N %s\n. Found S/N’s:\n” + snlist)
OSError: Failed to find USB device with S/N %s
. Found S/N’s:
50203120355448513030353238313033 (ChipWhisperer CW305)

giving the following full response:

import chipwhisperer as cw
scope = cw.scope()
Traceback (most recent call last):
File “c:\users\nalla\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 316, in txrx
response = self.open(serial_number=payload)
File “c:\users\nalla\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 354, in open
** raise OSError(“Failed to find USB device with S/N %s\n. Found S/N’s:\n” + snlist)**
OSError: Failed to find USB device with S/N %s
. Found S/N’s:
50203120355448513030353238313033 (ChipWhisperer CW305)

Hi,

Usually if we can’t find the ChipWhisperer, it means the device drivers aren’t installed. What does the Lite show up as in device manager? It should show up as a libusb-32 device, or as a Universal Serial Bus device if drivers are installed.

If you’re able to update the drivers for your Lite to the newest ones (0.30), it should automatically install the correct drivers. On our Updating Firmware page, we’ve got a section on updating your firmware if you’re not able to connect on Windows: https://chipwhisperer.readthedocs.io/en/latest/firmware.html#special-case-driverless-windows

Alex

Hi Alex,
It shows as

  1. a libusb-32 devices for ChipWhisperer Lite
  2. Universal Serial Bus device for ChipWhisperer CW305

Ses the attachmentDevice Drivers

Try unplugging your CW305 when trying to connect to your ChipWhisperer.

Alex

1 Like

Yes, now I unplugged my CW305. ChipWhisperer Lite only plugged. Now it is giving the warning when running the same comments: Your firmware is outdated, (and green led also blinking now)

import chipwhisperer as cw
scope = cw.scope()
WARNING:root:Your firmware is outdated - latest is 0.30. Suggested to update firmware, as you may experience errors
See Deprecated API — ChipWhisperer 5.7.0 documentation

Do I need to update the firmware now? if yes, please give steps if possible.

Hi,

The upgrade steps are linked in that warning message/my earlier post (two different pages, but they both cover the autoprogram step).

Alex

Hi,
I have uninstalled and then installed, updated the drivers from the corresponding directory (cwlite_usb_driver)…but, now I could not connect to the scope also.

When I am running the command scope = cw.scope(), then it’s giving the following error:
Warning: Could not connect to “NewAE USB (CWLite/CW1200)”. It may have been disconnected, is in an error state, or is being used by another tool.

I plugged only my ChipWhisperer Lite. Now device manager is shown as

  1. Universal Serial Bus device (ChipWhisperer Lite) and 2. Universal serial device (COM 5)

DM

How to fix this issue?

Can you try unplugging + replugging? If you run the connect script twice, you’ll run into that error. You should have gotten a longer error message there. Can you post the full error message if disconnecting+reconnecting doesn’t work?

Alex

Hi Axel,
Sorry for the late reply due to some other works!
I think it is working fine after updating the firmware. I got the following output when I am running the CW305 AES tutorial (no VM).

attack_results.key_guess()
[208, 20, 249, 168, 201, 238, 37, 137, 225, 63, 12, 200, 182, 99, 12, 166].

If I remember the last round key correctly, that’s correct.

Yes, Thanks!

How to plot a captured trace (no VM)?
I am running Demo code without Jupyter: PA_HW_CW305_1-Attacking_AES_on_an_FPGA

Getting no warning when I running the code below, but It can’t plot the captured trace (the plot doesn’t come out).

from bokeh.plotting import figure, show
from bokeh.io import output_notebook

output_notebook()
p = figure(plot_width=800)

xrange = range(len(traces[0]))
p.line(xrange, traces[0], line_color=“red”)
show( p)

Are you trying to plot in a notebook?

No. I installed ChipWhisperer 5.5 directly (no VM) and simply running the above (demo) code in python IDLE

I’d recommend just using matplotlib then:

IIRC it should be:

import matplotlib.pyplot as plt
plt.figure()
plt.plot(data)
plt.show()

Yes, Now I got the plot! Thanks!

Hi Alex,
How to perform a basic TVLA test:

I am unable to perform a basic TVLA test for my above experiments.

First I captured 100 power traces using the TVLA tutorial (It is working fine). However, based on the recorded data, now getting the following warning when running the
Analysis code from https://github.com/newaetech/chipwhisperer-jupyter/blob/e33f4a2c822d7c195674b11a1de72828907e7255/PA_TVLA_1-Performing_TVLA_Testing_for_Crypto_Validation.ipynb

giving the following warning:

WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.BokehRenderer: Use method ‘params’ via param namespace
100 129
WARNING:param.ParameterizedMetaclass: Use method ‘params’ via param namespace
WARNING:param.ParameterizedMetaclass:Use method ‘params’ via param namespace
WARNING:param.Overlay: Use method ‘params’ via param namespace
WARNING:param.Overlay:Use method ‘params’ via param namespace

Hi,

You can fix with https://github.com/newaetech/chipwhisperer/issues/324. This will be fixed in our next release as well.

Alex

1 Like

Ok, now no warnings!
Thanks!

1 Like

Hi Alex,

Again, now I receive the new error when I am running the following commands

import chipwhisperer as cw
scope = cw.scope()

giving the following long error:

Traceback (most recent call last):
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 448, in get_possible_devices
devlist = [{‘sn’: d.serial_number, ‘product’: d.product, ‘pid’: d.idProduct, ‘vid’: d.idVendor} for d in devlist]
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 448, in
devlist = [{‘sn’: d.serial_number, ‘product’: d.product, ‘pid’: d.idProduct, ‘vid’: d.idVendor} for d in devlist]
File “D:\ChipWhisperer5_64\git\home\portable\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\core.py”, line 854, in serial_number
self._serial_number = util.get_string(self, self.iSerialNumber)
File “D:\ChipWhisperer5_64\git\home\portable\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\util.py”, line 313, in get_string
raise ValueError(“The device has no langid”
ValueError: The device has no langid (permission issue, no string descriptors supported or device error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 448, in get_possible_devices
devlist = [{‘sn’: d.serial_number, ‘product’: d.product, ‘pid’: d.idProduct, ‘vid’: d.idVendor} for d in devlist]
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 448, in
devlist = [{‘sn’: d.serial_number, ‘product’: d.product, ‘pid’: d.idProduct, ‘vid’: d.idVendor} for d in devlist]
File “D:\ChipWhisperer5_64\git\home\portable\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\core.py”, line 854, in serial_number
self._serial_number = util.get_string(self, self.iSerialNumber)
File “D:\ChipWhisperer5_64\git\home\portable\WPy64-3771\python-3.7.7.amd64\lib\site-packages\usb\util.py”, line 313, in get_string
raise ValueError(“The device has no langid”
ValueError: The device has no langid (permission issue, no string descriptors supported or device error)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 314, in txrx
response = self.get_possible_devices(payload)
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 465, in get_possible_devices
return self.get_possible_devices(idProduct, dictonly, “libusb0”)
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 466, in get_possible_devices
raise OSError(“Unable to communicate with found ChipWhisperer. Check that another process isn’t connected to it and that you have permission to communicate with it.”)
OSError: Unable to communicate with found ChipWhisperer. Check that another process isn’t connected to it and that you have permission to communicate with it.
Traceback (most recent call last):
File “<pyshell#1>”, line 1, in
scope = cw.scope()
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer_init_.py”, line 228, in scope
scope_type = get_cw_type(sn)
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\common\utils\util.py”, line 500, in get_cw_type
possible_sn = cwusb.get_possible_devices(idProduct=possible_ids)
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 615, in get_possible_devices
return self.usbseralizer.get_possible_devices(idProduct)
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 134, in get_possible_devices
return self.process_rx(self.txrx(tx=cmdpacket))
File “d:\chipwhisperer5_64\git\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py”, line 154, in process_rx
raise payload
OSError: Unable to communicate with found ChipWhisperer. Check that another process isn’t connected to it and that you have permission to communicate with it.

Can you unplug + replug your ChipWhisperer? You might be connected in multiple notebooks or similar.

Alex