Possible damaged NAE-CWLITE-ARM Board

I bought an NAE-CWLITE-ARM from Mouser and successfully worked on the tutorials for two weeks. Suddenly the board stopped working in the middle of the operation of tutorial “Part 1, Topic 3: Clock Glitching to Dump Memory (MAIN)”. I had run the tutorial several times but was never successful. Then the board could always be addressed under USB, but the following error message always appears with %run “…/…/Setup_Scripts/Setup_Generic.ipynb”:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
~\chipwhisperer\jupyter\Setup_Scripts\Setup_Generic.ipynb in <module>
      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\Setup_Scripts\Setup_Generic.ipynb in <module>
      4         scope.con()
      5 except NameError:
----> 6     scope = cw.scope()
      7 
      8 try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in scope(scope_type, name, **kwargs)
    255 
    256     if scope_type is None:
--> 257         scope_type = get_cw_type(**kwargs)
    258     scope = scope_type()
    259     try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\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()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct)
    109     def find(self, serial_number=None, idProduct=None):
    110         # check if we got anything
--> 111         dev_list = self.get_possible_devices(idProduct)
    112         if len(dev_list) == 0:
    113             raise OSError("Could not find ChipWhisperer. Is it connected?")

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly)
    216         if len(dev_list) == 0:
    217             raise OSError("Unable to communicate with found ChipWhisperer. Check that \
--> 218                 \nanother process isn't connected to it and that you have permission to communicate with it.")
    219 
    220         return dev_list

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.

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_6008/3735934726.py in <module>
      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)
C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_6008/3439989707.py in <module>
----> 1 get_ipython().run_line_magic('run', '"../../Setup_Scripts/Setup_Generic.ipynb"')

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\IPython\core\interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth)
   2346                 kwargs['local_ns'] = self.get_local_scope(stack_depth)
   2347             with self.builtin_trap:
-> 2348                 result = fn(*args, **kwargs)
   2349             return result
   2350 

~\WPy64-3771\python-3.7.7.amd64\lib\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__

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\IPython\core\magic.py in <lambda>(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):

~\WPy64-3771\python-3.7.7.amd64\lib\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 

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\IPython\core\interactiveshell.py in safe_execfile_ipy(self, fname, shell_futures, raise_exceptions)
   2833                     result = self.run_cell(cell, silent=True, shell_futures=shell_futures)
   2834                     if raise_exceptions:
-> 2835                         result.raise_error()
   2836                     elif not result.success:
   2837                         break

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\IPython\core\interactiveshell.py in raise_error(self)
    329             raise self.error_before_exec
    330         if self.error_in_exec is not None:
--> 331             raise self.error_in_exec
    332 
    333     def __repr__(self):

    [... skipping hidden 1 frame]

C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_6008/3735934726.py in <module>
      4         scope.con()
      5 except NameError:
----> 6     scope = cw.scope()
      7 
      8 try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in scope(scope_type, name, **kwargs)
    255 
    256     if scope_type is None:
--> 257         scope_type = get_cw_type(**kwargs)
    258     scope = scope_type()
    259     try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\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()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct)
    109     def find(self, serial_number=None, idProduct=None):
    110         # check if we got anything
--> 111         dev_list = self.get_possible_devices(idProduct)
    112         if len(dev_list) == 0:
    113             raise OSError("Could not find ChipWhisperer. Is it connected?")

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly)
    216         if len(dev_list) == 0:
    217             raise OSError("Unable to communicate with found ChipWhisperer. Check that \
--> 218                 \nanother process isn't connected to it and that you have permission to communicate with it.")
    219 
    220         return dev_list

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.

Also, no LED was lit anymore, except for the blue flashing LED near the Atmel controller. The Atmel controller also gets quite warm. Also, the previously working tutorials no longer worked with the same error message after executing Setup_Generic.ipynb. However, I had noticed before the final failure that this error message was occasionally displayed. After a reset and restart from the tutorial, the board ran again. I then contacted Mouser and was advised to report my issue here on the board.

I hope you can help me here and thank you in advance for your support.

Regards Stefan

Hi Stefan,

Have you tried unplugging + replugging before trying to connect? If you connect from multiple notebooks at the same time, or multiple times in the same one, you’ll run into this error. A quick unplug + replug is usually the quickest way to fix this.

It’s normal that the device gets a bit warm since we’re running its max clock speed and using its internal regulator.

Alex

I’ve tried all of this before, unfortunately without success.

If you’ve got some extra USB cables kicking around, can you try a few different ones? If that doesn’t work, you can try reflashing the firmware? You’ll have to erase via the erase pins (CW1173 ChipWhisperer-Lite - NewAE Hardware Product Documentation), then you can use cw.program_sam_firmware(hardware_type='cwlite')) to upload the new firmware.

Alex

Hi Alex,
thank you for your help.

The update worked fine, but it seems to me that only the Atmel software has been updated. Shouldn’t the FPGA also be updated ?

import chipwhisperer as cw
cw.program_sam_firmware(hardware_type='cwlite')
Found COM4
Loading cwlite firmware...
Opened!
Connecting...
Connected!
Erasing...
Erased!
Programming file SAM3U_CW1173.bin...
Programmed!
Verifying...
Verify OK!
Resetting...
Upgrade successful

Unfortunately it still doesn’t work to run scripts:

import chipwhisperer as cw
scope = cw.scope()
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_2084/2383659183.py in <module>
----> 1 scope = cw.scope()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in scope(scope_type, name, **kwargs)
    255 
    256     if scope_type is None:
--> 257         scope_type = get_cw_type(**kwargs)
    258     scope = scope_type()
    259     try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\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()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct)
    109     def find(self, serial_number=None, idProduct=None):
    110         # check if we got anything
--> 111         dev_list = self.get_possible_devices(idProduct)
    112         if len(dev_list) == 0:
    113             raise OSError("Could not find ChipWhisperer. Is it connected?")

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly)
    216         if len(dev_list) == 0:
    217             raise OSError("Unable to communicate with found ChipWhisperer. Check that \
--> 218                 \nanother process isn't connected to it and that you have permission to communicate with it.")
    219 
    220         return dev_list

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.

I’ve tried different USB cables. One question I have is, has the FPGA also been updated ?

I would appreciate further support to be able to work successfully with the board again.

Greetings Stefan

Hi Stefan,

Actually, the FPGA only has volatile memory, so it effectively gets updated every time you turn the device on + reconnect. This is why the first connection after powering on takes a bit longer.

Can you try the following code and report :

import chipwhisperer as cw
cw.naeusb_logger.setLevel(cw.logging.DEBUG)
scope = cw.scope()

and send the output?

Alex

Hello Alex,
here is the output:

import chipwhisperer as cw
cw.naeusb_logger.setLevel(cw.logging.DEBUG)
scope = cw.scope()

INFO:ChipWhisperer NAEUSB:Found NAEUSB devices [<usb1.USBDevice object at 0x0000018DC63A9FC8>]
INFO:ChipWhisperer NAEUSB:Found NAEUSB devices [<usb1.USBDevice object at 0x0000018DC63A9FC8>]
INFO:ChipWhisperer NAEUSB:Attempt to access ChipWhisperer failed, skipping to next
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_4536/2383659183.py in <module>
----> 1 scope = cw.scope()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in scope(scope_type, name, **kwargs)
    255 
    256     if scope_type is None:
--> 257         scope_type = get_cw_type(**kwargs)
    258     scope = scope_type()
    259     try:

c:\users\dagobe~1\chipwh~1\cw\home\portable\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()

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct)
    109     def find(self, serial_number=None, idProduct=None):
    110         # check if we got anything
--> 111         dev_list = self.get_possible_devices(idProduct)
    112         if len(dev_list) == 0:
    113             raise OSError("Could not find ChipWhisperer. Is it connected?")

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly)
    216         if len(dev_list) == 0:
    217             raise OSError("Unable to communicate with found ChipWhisperer. Check that \
--> 218                 \nanother process isn't connected to it and that you have permission to communicate with it.")
    219 
    220         return dev_list

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.

I am currently trying to install the tool chain on another Windows computer and have the error that access to “USB1” leads to an error. Before that I always worked with a Windows 10 under VMWare.

import chipwhisperer as cw
scope = cw.scope()

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
c:\users\stefan~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in <module>
     14 try:
---> 15     import usb1 # type: ignore
     16 except Exception as e:

ModuleNotFoundError: No module named 'usb1'

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
<ipython-input-1-a074e77f8699> in <module>
----> 1 import chipwhisperer as cw
      2 scope = cw.scope()

c:\users\stefan~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in <module>
     15     import usb1 # type: ignore
     16 except Exception as e:
---> 17     raise ImportError("Could not import usb1. usb1 is required for ChipWhisperer >= 5.6.1. Try pip install libusb1.") from e
     18 import os, os.path, time
     19 from zipfile import ZipFile

ImportError: Could not import usb1. usb1 is required for ChipWhisperer >= 5.6.1. Try pip install libusb1.

I’ve also tried libusb1, which also gives errors.

Hi Stefan,

Can you try running this code:

import os, subprocess, sys
os.environ['LIBUSB_DEBUG'] = '4'
x = subprocess.run([sys.executable, '-c', 'import chipwhisperer as cw; scope = cw.scope()'], check=True, env=os.environ, capture_output=True)
print(x.stderr.decode())

Also it’s weird that you didn’t get libusb1 automatically when you installed chipwhisperer, since it should come with the installation. What error do you get with libusb1?

Alex

Hallo Alex,
I ran your test code on Windows 10 in VMWare. I have USB drivers installed on my real PC which may cause problems with Chipwhisperer. That’s why I uninstalled Chipwhisperer there. A freshly installed Windows under VMWare is better. I just see that the script is wrong. WinUSB is installed under VMWare. The script shouldn’t work like this

import os, subprocess, sys
os.environ['LIBUSB_DEBUG'] = '4'
x = subprocess.run([sys.executable, '-c', 'import chipwhisperer as cw; scope = cw.scope()'], check=True, env=os.environ, capture_output=True)
print(x.stderr.decode())

---------------------------------------------------------------------------
CalledProcessError                        Traceback (most recent call last)
C:\Users\DAGOBE~1\AppData\Local\Temp/ipykernel_4888/1545665416.py in <module>
      1 import os, subprocess, sys
      2 os.environ['LIBUSB_DEBUG'] = '4'
----> 3 x = subprocess.run([sys.executable, '-c', 'import chipwhisperer as cw; scope = cw.scope()'], check=True, env=os.environ, capture_output=True)
      4 print(x.stderr.decode())

~\WPy64-3771\python-3.7.7.amd64\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
    510         if check and retcode:
    511             raise CalledProcessError(retcode, process.args,
--> 512                                      output=stdout, stderr=stderr)
    513     return CompletedProcess(process.args, retcode, stdout, stderr)
    514 

CalledProcessError: Command '['C:\\Users\\DAGOBE~1\\CHIPWH~1\\cw\\home\\portable\\WPy64-3771\\python-3.7.7.amd64\\python.exe', '-c', 'import chipwhisperer as cw; scope = cw.scope()']' returned non-zero exit status 1.

Whoops, try

import os, subprocess, sys
os.environ['LIBUSB_DEBUG'] = '4'
try:
    x = subprocess.run([sys.executable, '-c', 'import chipwhisperer as cw; scope = cw.scope()'], check=True, env=os.environ, capture_output=True)
    print(x.stderr.decode())
except Exception as x:
    print(x.stderr.decode())
    print(x.stdout.decode())

I don’t think usb drivers for other devices will cause issues. Also, I’m not sure what you mean by WinUSB being installed, as WinUSB is built into Windows.

Alex

Hello Alex,
I used a fresh new Windows 10 as a VMWare image and reinstalled everything again, setting the USB driver to libusb0 (v1.2.6.0) with zadig-2.7. After running your script, the LED D4 near the FPGA will blink, which was not the case before. I think, that the chipwhisperer is now ok again.

On my real computer I saw in the device manager that the WinUSB driver was always activated. To be able to start your script from yesterday, I tried to install libusb0 (v1.2.6.0) with Zadig. However, the WinUSB and the libusb entrys for Chipwhisperer were always visible in the device manager. I can’t uninstall winusb. Uninstalling the drivers didn’t help either. After I reconnected Chipwhisper to the computer, the WinUSB entries were visible again in the device manager. Exactly the same could be seen in my old installation under VMWare in the device manager. In the new(!) VMWare installation, WinUSB is probably installed by default. I reinstalled the drivers for libusb0 with Zadig and now it looks better. Now only the libusb0 entry for Chipwhisperer is visible in Device Manager. I’m going to run a script from the training section now and I hope it works.

Working VMWare Installation:

Failed old VMWare Installation:

I have now also tried a script from the course and everything is working fine again.
Thank you Alex for your support :slight_smile: I am very happy that the hardware is ok.

Good to hear that you got it working again, but you shouldn’t use the libusb0 driver. WinUSB is the correct driver to use. Also, if WinUSB gets used automatically, you shouldn’t use Zadig to change it. This might’ve been why you were running into issues.

Hello Alex,
I have now run a few scripts. That also worked well and suddenly I had the messages from my first posting again. I then set everything up again under VMWare, but this time there was no improvement. Then I tried reprogramming the software onto the Atmel controller and that didn’t work. The following message now always appears:


---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in <module>
     14 try:
---> 15     import usb1 # type: ignore
     16 except Exception as e:

ModuleNotFoundError: No module named 'usb1'

The above exception was the direct cause of the following exception:

ImportError                               Traceback (most recent call last)
<ipython-input-1-757d0be50895> in <module>
----> 1 import chipwhisperer as cw

c:\users\dagobe~1\chipwh~1\cw\home\portable\chipwhisperer\software\chipwhisperer\__init__.py in <module>
     15     import usb1 # type: ignore
     16 except Exception as e:
---> 17     raise ImportError("Could not import usb1. usb1 is required for ChipWhisperer >= 5.6.1. Try pip install libusb1.") from e
     18 import os, os.path, time
     19 from zipfile import ZipFile

ImportError: Could not import usb1. usb1 is required for ChipWhisperer >= 5.6.1. Try pip install libusb1.

When I connect the chipwhisperer to the computer, the device appears in the device manager under the COM3 interface. The error message shows that Chipwhisperer is expected on COM1.

All I did was run the scripts under Course “jupyter/courses/fault101”.

Greetings Stefan

Hi Stefan,

That error says that you don’t have python-libusb1 installed, which is the python library that we use for USB communication. COMX for ChipWhisperers are just optional serial ports, so you don’t really need to worry about them.

Try running the following in jupyter:

%%bash
python -m pip install -y libusb1

Alex

Hello Alex,
I’ve tried a few things, but I don’t know how to execute the statement in jupyter.
In the graphic there is Python 3 and Terminal. I tried both without success.

Greetings
Stefan

Hi Stefen,

You can execute that in the Python 3 notebook.

Alex

The “-y” option is too much

Flashing the firmware also worked.