Hi!
I’m trying to follow along with the Lab 2_1B - Power Analysis for Password Bypass (HARDWARE) tutorial with a CWNANO (NAE-CW1101-04).
Communication with board works perfectly fine, as well as programming the target, however - when trying to capture a trace (following along exactly with the same code in the tutorial) a USBError is being raised during capture():
Traceback (most recent call last):
File "/home/vagrant/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 290, in txrx
response = self.cmdReadMem(addr, dlen)
File "/home/vagrant/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py", line 473, in cmdReadMem
data = self.usbdev().read(self.rep, dlen, timeout=self._timeout)
File "/home/vagrant/.pyenv/versions/3.6.7/envs/cw/lib/python3.6/site-packages/pyusb-1.0.2-py3.6.egg/usb/core.py", line 988, in read
self.__get_timeout(timeout))
File "/home/vagrant/.pyenv/versions/3.6.7/envs/cw/lib/python3.6/site-packages/pyusb-1.0.2-py3.6.egg/usb/backend/libusb0.py", line 542, in bulk_read
timeout)
File "/home/vagrant/.pyenv/versions/3.6.7/envs/cw/lib/python3.6/site-packages/pyusb-1.0.2-py3.6.egg/usb/backend/libusb0.py", line 627, in __read
timeout
File "/home/vagrant/.pyenv/versions/3.6.7/envs/cw/lib/python3.6/site-packages/pyusb-1.0.2-py3.6.egg/usb/backend/libusb0.py", line 431, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'No error'
---------------------------------------------------------------------------
USBError Traceback (most recent call last)
<ipython-input-5-f4bac772fbe6> in <module>
----> 1 x = cap_pass_trace("h\n")
2 print(x)
<ipython-input-3-addfe96922f3> in cap_pass_trace(pass_guess)
9 scope.arm()
10 target.write(pass_guess)
---> 11 ret = scope.capture()
12 if ret:
13 print('Timeout happened during acquisition')
~/work/projects/chipwhisperer/software/chipwhisperer/capture/scopes/cwnano.py in capture(self)
633 return True
634
--> 635 self._lasttrace = self._cwusb.cmdReadMem(0, self.adc.samples)
636
637 self._lasttrace = np.array(self._lasttrace) / 256.0 - 0.5
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in cmdReadMem(self, addr, dlen)
646 """
647
--> 648 return self.usbseralizer.cmdReadMem(addr, dlen)
649
650 def cmdWriteMem(self, addr, data):
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in cmdReadMem(self, addr, dlen)
199 cmdpacket = self.make_cmd(self.CMD_READ_MEM, payload)
200
--> 201 return self.process_rx(self.txrx(tx=cmdpacket))
202
203 def cmdWriteMem(self, addr, data):
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in process_rx(self, inp)
152 print(resp)
153 print(payload)
--> 154 raise payload
155
156 return payload
USBError: [Errno None] None
I’m using the example code given in the documentation:
https://chipwhisperer.readthedocs.io/en/latest/api.html?highlight=simpleserial_wait_ack#chipwhisperer.capture_trace
Yet it says nothing about a USB Error.
I’ve made sure that the scope is configured as CWNANO rather than anything else, and also - this only happens when I send a plaintext with terminating \n.
So I have a reason to believe that in fact there is some trace to get, but something in the processing is gone awry.
What am I missing?
Thanks in advance