Firmware Issue with CPA Tutorial 1

Hiya,

I am having some issues attempting to configure my software environment in order to properly run through the Jupyter Notebook script for the “PA_CPA_1-Using_CW-Analyzer_for_CPA_Attack” tutorial. I have installed the prerequisite software mentioned on the ChipWhisperer website “natively” through Linux manually following https://chipwhisperer.readthedocs.io/en/latest/prerequisites.html#gnu-linux (which I think is the latest version) and then https://chipwhisperer.readthedocs.io/en/latest/installing.html#install-repo via the Git option. I am running on Python3 with an Ubuntu 20.04 virtual machine OS on top of my actual Windows 10 system.

I am able to access the Jupyter Notebook tutorial files on the VM OS, however in running one line to check for my hardware connection status (to a CW Nano), the following line is yielding an error:

%run “Helper_Scripts/Setup_Generic.ipynb”


NameError Traceback (most recent call last)
~/chipwhisperer/jupyter/archive/Helper_Scripts/Setup_Generic.ipynb in
2 try:
----> 3 if not scope.connectStatus:
4 scope.con()

NameError: name ‘scope’ is not defined

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
~/chipwhisperer/jupyter/archive/Helper_Scripts/Setup_Generic.ipynb in
4 scope.con()
5 except NameError:
----> 6 scope = cw.scope()
7
8 try:

~/chipwhisperer/software/chipwhisperer/init.py in scope(scope_type, name, **kwargs)
300
301 if scope_type is None:
–> 302 scope_type = get_cw_type(**kwargs)
303 scope = scope_type()
304 try:

~/chipwhisperer/software/chipwhisperer/common/utils/util.py in get_cw_type(sn, idProduct, **kwargs)
503
504 cwusb = NAEUSB_Backend()
–> 505 device = cwusb.find(serial_number=sn, idProduct=possible_ids)
506 name = device.getProduct()
507 cwusb.usb_ctx.close()

~/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in find(self, serial_number, idProduct)
198 dev_list = self.get_possible_devices(idProduct)
199 if len(dev_list) == 0:
–> 200 raise OSError(“Could not find ChipWhisperer. Is it connected?”)
201
202 # if more than one CW, we require a serial number

OSError: Could not find ChipWhisperer. Is it connected?


NameError Traceback (most recent call last)
/tmp/ipykernel_2677/1120177331.py in
2 try:
----> 3 if not scope.connectStatus:
4 scope.con()

NameError: name ‘scope’ is not defined

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
/tmp/ipykernel_2677/2227274903.py in
----> 1 get_ipython().run_line_magic(‘run’, ‘“Helper_Scripts/Setup_Generic.ipynb”’)

~/.local/lib/python3.8/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
2349 kwargs[‘local_ns’] = self.get_local_scope(stack_depth)
2350 with self.builtin_trap:
-> 2351 result = fn(*args, **kwargs)
2352 return result
2353

~/.local/lib/python3.8/site-packages/decorator.py in fun(*args, **kw)
230 if not kwsyntax:
231 args, kw = fix(args, kw, sig)
–> 232 return caller(func, *(extras + args), **kw)
233 fun.name = func.name
234 fun.doc = func.doc

~/.local/lib/python3.8/site-packages/IPython/core/magic.py in (f, *a, **k)
185 # but it’s overkill for just that one bit of state.
186 def magic_deco(arg):
–> 187 call = lambda f, *a, **k: f(*a, **k)
188
189 if callable(arg):

~/.local/lib/python3.8/site-packages/IPython/core/magics/execution.py in run(self, parameter_s, runner, file_finder)
722 with preserve_keys(self.shell.user_ns, ‘file’):
723 self.shell.user_ns[‘file’] = filename
–> 724 self.shell.safe_execfile_ipy(filename, raise_exceptions=True)
725 return
726

~/.local/lib/python3.8/site-packages/IPython/core/interactiveshell.py in safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
2836 result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
2837 if raise_exceptions:
-> 2838 result.raise_error()
2839 elif not result.success:
2840 break

~/.local/lib/python3.8/site-packages/IPython/core/interactiveshell.py in raise_error(self)
330 raise self.error_before_exec
331 if self.error_in_exec is not None:
–> 332 raise self.error_in_exec
333
334 def repr(self):

[... skipping hidden 1 frame]

/tmp/ipykernel_2677/1120177331.py in
4 scope.con()
5 except NameError:
----> 6 scope = cw.scope()
7
8 try:

~/chipwhisperer/software/chipwhisperer/init.py in scope(scope_type, name, **kwargs)
300
301 if scope_type is None:
–> 302 scope_type = get_cw_type(**kwargs)
303 scope = scope_type()
304 try:

~/chipwhisperer/software/chipwhisperer/common/utils/util.py in get_cw_type(sn, idProduct, **kwargs)
503
504 cwusb = NAEUSB_Backend()
–> 505 device = cwusb.find(serial_number=sn, idProduct=possible_ids)
506 name = device.getProduct()
507 cwusb.usb_ctx.close()

~/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in find(self, serial_number, idProduct)
198 dev_list = self.get_possible_devices(idProduct)
199 if len(dev_list) == 0:
–> 200 raise OSError(“Could not find ChipWhisperer. Is it connected?”)
201
202 # if more than one CW, we require a serial number

OSError: Could not find ChipWhisperer. Is it connected?

I am quite new to the ChipWhisprer, and do not know much regarding the error above and what it could mean. I have heard that this error may be being caused by outdated firmware and a USB driver error, but not much more specific than that. Does anyone have any advice on how to proceed from here? I am eventually trying to run through some of PA_DPA_3-AES_DPA_Attack.ipynb for an assignment. Thanks!

Hi,

Are you using VirtualBox or VMWare? If you’re using VirtualBox, you’ll need to have the VirtualBox extensions installed (https://www.virtualbox.org/wiki/Downloads) and you’ll also need to pass the ChipWhisperer through to the guest OS: https://www.eltima.com/article/virtualbox-usb-passthrough/

Alex

1 Like