Demos>PA_HW_CW305_1-Attacking_AES_on_an_FPGA

Hello,
I have a problem in the capture setup section. Although I tried every combination of the code “target = cw.target(scope, cw.targets.CW305, fpga_id=‘100t’, force=False)” (35t,100t,False,True), I receive the same error.

OSError Traceback (most recent call last)
in
----> 1 target = cw.target(scope, cw.targets.CW305, fpga_id=‘100t’, force=True)

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer_init_.py in target(scope, target_type, **kwargs)
364 “”"
365 rtn = target_type()
→ 366 rtn.con(scope, **kwargs)
367
368 # need to check

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets_base.py in con(self, scope, **kwargs)
63 try:
64 self.connectStatus = True
—> 65 self._con(scope, **kwargs)
66 except:
67 self.dis()

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets\CW305.py in _con(self, scope, bsfile, force, fpga_id, defines_files, slurp, prog_speed)
295 slurp (bool, optional): Whether or not to slurp the Verilog defines.
296 “”"
→ 297 self._naeusb.con(idProduct=[0xC305])
298 if not fpga_id is None:
299 if fpga_id not in (‘100t’, ‘35t’):

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in con(self, idProduct, connect_to_first, serial_number, hw_location, **kwargs)
666 Connect to device using default VID/PID
667 “”"
→ 668 self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
669
670

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in open(self, serial_number, idProduct, connect_to_first, hw_location)
363 “”"
364
→ 365 self.device = self.find(serial_number, idProduct, hw_location=hw_location)
366 if connect_to_first == False:
367 return None

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct, hw_location)
328 hw_location : Optional[Tuple[int, int]]=None) → usb1.USBDevice:
329 # check if we got anything
→ 330 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
331 if len(dev_list) == 0:
332 raise OSError(“Could not find ChipWhisperer. Is it connected?”)

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly, attempt_access)
453 if len(dev_list) == 0:
454 raise OSError(“Unable to communicate with found ChipWhisperer. Check that
→ 455 \nanother process isn’t connected to it and that you have permission to communicate with it.”)
456
457 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 attached my hardware in case I might have a wrong connection setup. Thanks in advance.

What numbers do the 7-segment displays show on the CW305? Normally it should be 1.00 or very close to it. It may be getting insufficient power from USB. Try a different USB port, or use the DC jack.

If this still doesn’t work, which (if any) LEDs do you see on the board? There should be a red flashing LED just above the FPGA JTAG connector (near the letter “L” on the large Atmel chip).
Jean-Pierre

Hello @jpthibault ,
As you can see in the new picture attached, I use a DC jack for the power, I see 1.00 on the 7-segment display, and 3 LEDs are ON, but none of them are flashing. It must be because of the error I get. In the last trial, I got a different error message. I leave a message here. I am open to every thought. Thank you.

OSError Traceback (most recent call last)
in
1 #target = cw.target(scope, cw.targets.CW305, fpga_id=‘35t’, force=False)
----> 2 target = cw.target(scope, cw.targets.CW305, fpga_id=‘100t’, force=False)

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer_init_.py in target(scope, target_type, **kwargs)
364 “”"
365 rtn = target_type()
→ 366 rtn.con(scope, **kwargs)
367
368 # need to check

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets_base.py in con(self, scope, **kwargs)
63 try:
64 self.connectStatus = True
—> 65 self._con(scope, **kwargs)
66 except:
67 self.dis()

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\capture\targets\CW305.py in _con(self, scope, bsfile, force, fpga_id, defines_files, slurp, prog_speed)
295 slurp (bool, optional): Whether or not to slurp the Verilog defines.
296 “”"
→ 297 self._naeusb.con(idProduct=[0xC305])
298 if not fpga_id is None:
299 if fpga_id not in (‘100t’, ‘35t’):

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in con(self, idProduct, connect_to_first, serial_number, hw_location, **kwargs)
666 Connect to device using default VID/PID
667 “”"
→ 668 self.usbtx.open(idProduct=idProduct, serial_number=serial_number, connect_to_first=True, hw_location=hw_location)
669
670

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in open(self, serial_number, idProduct, connect_to_first, hw_location)
363 “”"
364
→ 365 self.device = self.find(serial_number, idProduct, hw_location=hw_location)
366 if connect_to_first == False:
367 return None

c:\users\cetin\chipwhisperer5_64\cw\home\portable\chipwhisperer\software\chipwhisperer\hardware\naeusb\naeusb.py in find(self, serial_number, idProduct, hw_location)
330 dev_list = self.get_possible_devices(idProduct, attempt_access=(not hw_location))
331 if len(dev_list) == 0:
→ 332 raise OSError(“Could not find ChipWhisperer. Is it connected?”)
333
334 # if more than one CW, we require a serial number

OSError: Could not find ChipWhisperer. Is it connected?

Hello,
I have a “” UndefinedError: ‘bundle’ is undefined “” error. As far as I’m concerned, I am the first person who has this error in this forum. Therefore, I attached a ss and the error code here. Please let me know in this regard. Thanks!


UndefinedError Traceback (most recent call last)
in
2 from bokeh.io import output_notebook
3
----> 4 output_notebook()
5 p = figure(plot_width=800)
6

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\io\output.py in output_notebook(resources, verbose, hide_banner, load_timeout, notebook_type)
115 # verify notebook_type first in curstate().output_notebook
116 curstate().output_notebook(notebook_type)
→ 117 run_notebook_hook(notebook_type, ‘load’, resources, verbose, hide_banner, load_timeout)
118
119 def reset_output(state=None):

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\io\notebook.py in run_notebook_hook(notebook_type, action, *args, **kw)
300 if _HOOKS[notebook_type][action] is None:
301 raise RuntimeError(“notebook hook for %r did not install %r action” % notebook_type, action)
→ 302 return _HOOKS[notebook_type][action](*args, **kw)
303
304 #-----------------------------------------------------------------------------

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\io\notebook.py in load_notebook(resources, verbose, hide_banner, load_timeout)
413 custom_models_js = bundle_all_models() or “”
414
→ 415 nb_js = _loading_js(resources, element_id, custom_models_js, load_timeout, register_mime=True)
416 jl_js = _loading_js(resources, element_id, custom_models_js, load_timeout, register_mime=False)
417

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\io\notebook.py in _loading_js(resources, element_id, custom_models_js, load_timeout, register_mime)
546 force = True,
547 timeout = load_timeout,
→ 548 register_mime = register_mime
549 )
550

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\jinja2\environment.py in render(self, *args, **kwargs)
1088 return concat(self.root_render_func(self.new_context(vars)))
1089 except Exception:
→ 1090 self.environment.handle_exception()
1091
1092 def render_async(self, *args, **kwargs):

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\jinja2\environment.py in handle_exception(self, source)
830 from .debug import rewrite_traceback_stack
831
→ 832 reraise(*rewrite_traceback_stack(source=source))
833
834 def join_path(self, template, parent):

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\jinja2_compat.py in reraise(tp, value, tb)
26 def reraise(tp, value, tb=None):
27 if value.traceback is not tb:
—> 28 raise value.with_traceback(tb)
29 raise value
30

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\core_templates\autoload_nb_js.js in top-level template code()
----> 1 {% extends “autoload_js.js” %}
2
3 {% block register_mimetype %}
4
5 {%- if register_mime -%}

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\bokeh\core_templates\autoload_js.js in top-level template code()
92 }
93
—> 94 const hashes = {{ bundle.hashes|tojson }};
95
96 for (let i = 0; i < js_urls.length; i++) {

~\WPy64-3771\python-3.7.7.amd64\lib\site-packages\jinja2\environment.py in getattr(self, obj, attribute)
469 “”"
470 try:
→ 471 return getattr(obj, attribute)
472 except AttributeError:
473 pass

UndefinedError: ‘bundle’ is undefined

Hi,

My best guess for this is that there’s some sort of version mismatch between some of your packages.

Try running the following from jupyter/ChipWhisperer Updating.ipynb:

%%bash
python -m pip pip install -r requirements.txt --upgrade

Then restart and rerun your notebook.

EDIT: Instead of the above, close jupyter and navigate to the chipwhisperer/jupyter in a terminal, then run the Python command. Some packages are in use with Jupyter open, so not everything will be updated if it’s running.

Alex

Hi Alex,
Thank you for the suggestion. I tried it and nothing changed(please see the picture and the output). Do you think it is because I didn’t use Xilinx Vivado during the implementation? I wanted to observe the demo, so I just connected CW-Pro and CW-305 to my PC and ran the code without Vivado. Even though I didn’t use Xilinx Vivado so far, I am able to run the attack and get the keys successfully. The only problem is that I get the error while plotting the captured traces. Do you think that I should change some commands for plotting? Thanks.


Requirement already satisfied: pip in c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages (22.3.1) Note: you may need to restart the kernel to use updated packages.

WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -ycryptodome (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages) WARNING: Ignoring invalid distribution -illow (c:\users\cetin\chipwhisperer5_64\cw\home\portable\wpy64-3771\python-3.7.7.amd64\lib\site-packages)

Hi,

You first need to close Jupyter. Do can do this by going to localhost:8888 in your browser and hitting the quit button at the top right of the page.

Next, run ChipWhisperer Bash, which is installed alongside ChipWhisperer. Finally, run the following command:

cd /home/portable/chipwhisperer/jupyter
python -m pip pip install -r requirements.txt --upgrade

Alex

Hi Alex,
It worked, thanks!