Connection error after ChipWhisperer firmware upgrade

After I upgraded the ChipWhisperer firmware using ‘ChipWhisperer Firmware.ipynb’, I cannot connect anymore.

“error:chipwhisperer scope:chipwhisperer error state detected. resetting and retrying connection”

Thus, I tried to remove hardware drivers and reinstall, however, it was impossible.

Now, I got the following errors.

How can I solve this problem?

=== full error message ===

NoBackendError Traceback (most recent call last)
in
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

~\anaconda3\lib\site-packages\chipwhisperer_init_.py in scope(scope_type, sn)
227 from chipwhisperer.common.utils.util import get_cw_type
228 if scope_type is None:
→ 229 scope_type = get_cw_type(sn)
230 scope = scope_type()
231 try:

~\anaconda3\lib\site-packages\chipwhisperer\common\utils\util.py in get_cw_type(sn)
498
499 cwusb = NAEUSB()
→ 500 possible_sn = cwusb.get_possible_devices(idProduct=possible_ids)
501 name = “”
502 if len(possible_sn) == 0:

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct)
667
668 def get_possible_devices(self, idProduct):
→ 669 return self.usbseralizer.get_possible_devices(idProduct)
670
671 def get_cdc_settings(self):

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct)
135 “”“Get a list of connected USB devices.”“”
136 cmdpacket = self.make_cmd(self.GET_POSSIBLE_DEVICES, idProduct)
→ 137 return self.process_rx(self.txrx(tx=cmdpacket))
138
139 def process_rx(self, inp):

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in txrx(self, tx)
324 #naeusb_logger.debug(“CMD_WRITE_MEM_SAM3U: addr: {}”) #skip this one for now
325 elif cmd == self.GET_POSSIBLE_DEVICES:
→ 326 response = self.get_possible_devices(payload)
327 elif cmd == self.OPEN:
328 response = self.open(serial_number=payload)

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in get_possible_devices(self, idProduct, dictonly, backend)
444 for id in idProduct:
445 if id:
→ 446 dev = list(usb.core.find(idProduct=id, **my_kwargs))
447 else:
448 dev = list(usb.core.find(**my_kwargs))

~\anaconda3\lib\site-packages\usb\core.py in find(find_all, backend, custom_match, **args)
1307 break
1308 else:
→ 1309 raise NoBackendError(‘No backend available’)
1310
1311 if find_all:

NoBackendError: No backend available

Hi,

I had the same problem.
Can you check what device is connected in the device manager?
You may have the cw in bootloader mode know.
You need to flash the firmware manually.

I did use the following commands:

> import chipwhisperer as cw
> programmer = cw.SAMFWLoader(scope=None)
> programmer.program(<port>, hardware_type='cw1200')

For the <port> I did use the COM-Port seen in the device manager like this:

import chipwhisperer as cw
programmer = cw.SAMFWLoader(scope=None)
programmer.program('COM1', hardware_type='cw1200')

hope this helps.

Edit:
There is also a windows executable you could use:

https://github.com/newaetech/chipwhisperer/releases/download/5.4/firmware_updater.exe

usage is as follows:

firmware_updater.exe <COM_PORT> <HARDWARE_TYPE>

firmware_updater.exe COM4 cw1200

-e

Hi,

Can you post the full error message?

Alex

Thanks for answering. When I connected another PC, there was nothing wrong. Thus, I think it is not a firmware update issue and the hardware driver seems to have been installed incorrectly.

I attached the full error message to the post.

Whoops, completely missed that part.

It seems to just be an issue with anaconda. Please see https://github.com/newaetech/chipwhisperer/issues/348

Alex

I followed the instructions at the link mentioned above, but it didn’t work out for me.

After I reinstalled everything includes windows 10, connecting CW1200 was succeeded.

However, I still cannot connect with CWlite.

When I connected another PC, there was nothing wrong.

Unfortunately, I have to fix this problem because I have to use the computer where this problem occurred.

I got the following error message.

=== full error message ===

ERROR:ChipWhisperer Scope:ChipWhisperer error state detected. Resetting and retrying connection…

OSError Traceback (most recent call last)
~\anaconda3\lib\site-packages\chipwhisperer_ init _.py in scope(scope_type, name, **kwargs)
259 try:
–> 260 scope.con(**kwargs)
261 except IOError:

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\OpenADC.py in con(self, sn, idProduct, bitstream, force)
293
–> 294 self.scopetype.con(sn, idProduct, bitstream)
295 self.sc = OpenADCInterface(self.scopetype.ser)

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\openadc_interface\naeusbchip.py in con(self, sn, idProduct, bitstream, force)
75 if bitstream is None:
—> 76 self.getFWConfig().loadRequired()
77 else:

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, forceFirmware)
222 “”“Load firmware file or FPGA file only as required, skip otherwise”""
–> 223 self.loader.loadRequired(self.loadFPGA, forceFirmware)
224

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, callback, forceFirmware)
136 def loadRequired(self, callback, forceFirmware=False):
–> 137 callback()
138

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
249
–> 250 self.loader.loadFPGA()
251 scope_logger.info(‘FPGA programmed’)

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
143 if self.driver.isFPGAProgrammed() == False:
–> 144 self.driver.FPGAProgram(self.fpga_bitstream())
145 else:

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\fpga.py in FPGAProgram(self, bitstream, exceptOnDoneFailure)
89 if programStatus == False and exceptOnDoneFailure:
—> 90 raise IOError(“FPGA Done pin failed to go high, bad bitstream?”, bitstream)
91

OSError: [Errno FPGA Done pin failed to go high, bad bitstream?] <zipfile.ZipExtFile [closed]>

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
in
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

~\anaconda3\lib\site-packages\chipwhisperer_ init _.py in scope(scope_type, name, **kwargs)
261 except IOError:
262 scope_logger.error(“ChipWhisperer error state detected. Resetting and retrying connection…”)
–> 263 scope._getNAEUSB().reset()
264 time.sleep(2)
265 scope = scope_type()

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in reset(self)
601 “”" Reset the SAM3U. Requires firmware 0.30 or later
602 “”"
–> 603 self.sendCtrl(0x22, 0x10)
604
605 def read(self, dlen, timeout=2000):

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in sendCtrl(self, cmd, value, data)
452 “”"
453 # Vendor-specific, OUT, interface control transfer
–> 454 self.usbseralizer.sendCtrl(cmd, value, data)
455
456 def readCtrl(self, cmd, value=0, dlen=0):

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\naeusb.py in sendCtrl(self, cmd, value, data)
228 bRequest: {:02X}, wValue: {:04X}, wIndex: {:04X}, data: {}".format(0x41, cmd,
229 value, 0, data))
–> 230 self.handle.controlWrite(0x41, cmd, value, 0, data, timeout=self._timeout)
231 #return self.usbdev().ctrl_transfer(0x41, cmd, value, 0, data, timeout=self._timeout)
232

AttributeError: ‘NoneType’ object has no attribute ‘controlWrite’

Hi,

Can you try forcing an install of 5.5.2? pip install chipwhisperer==5.5.2.

Alex

Thanks for helping me.

After I installed 5.5.2, the CW1200 that was originally connected was not connected. There was NoBackendError, thus I followed the instructions at the link mentioned above (https://github.com/newaetech/chipwhisperer/issues/348) and resolve it.

There was something different, but CWlite is still not connected.

The red light D2 blinked twice and I got the following error message.

=== full error message ===

ERROR:ChipWhisperer Scope:ChipWhisperer error state detected. Resetting and retrying connection…

OSError Traceback (most recent call last)
~\anaconda3\lib\site-packages\chipwhisperer_ init _.py in scope(scope_type, sn)
231 try:
–> 232 scope.con(sn)
233 except IOError:

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\base.py in con(self, sn)
57 def con(self, sn=None):
—> 58 if self._con(sn):
59 self.connectStatus = True

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\OpenADC.py in _con(self, sn)
246 if self.scopetype is not None:
–> 247 self.scopetype.con(sn)
248

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\openadc_interface\naeusbchip.py in con(self, sn)
101 try:
–> 102 self.getFWConfig().loadRequired()
103 except:

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, forceFirmware)
222 “”“Load firmware file or FPGA file only as required, skip otherwise”""
–> 223 self.loader.loadRequired(self.loadFPGA, forceFirmware)
224

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, callback, forceFirmware)
136 def loadRequired(self, callback, forceFirmware=False):
–> 137 callback()
138

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
249
–> 250 self.loader.loadFPGA()
251 scope_logger.info(‘FPGA programmed’)

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
143 if self.driver.isFPGAProgrammed() == False:
–> 144 self.driver.FPGAProgram(self.fpga_bitstream())
145 else:

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\fpga.py in FPGAProgram(self, bitstream, exceptOnDoneFailure)
83 if programStatus == False and exceptOnDoneFailure:
—> 84 raise IOError(“FPGA Done pin failed to go high, bad bitstream?”, bitstream)
85

OSError: [Errno FPGA Done pin failed to go high, bad bitstream?] <zipfile.ZipExtFile [closed]>

During handling of the above exception, another exception occurred:

OSError Traceback (most recent call last)
in
1 import chipwhisperer as cw
----> 2 scope = cw.scope()

~\anaconda3\lib\site-packages\chipwhisperer_ init _.py in scope(scope_type, sn)
236 time.sleep(2)
237 scope = scope_type()
–> 238 scope.con(sn)
239 return scope
240

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\base.py in con(self, sn)
56
57 def con(self, sn=None):
—> 58 if self._con(sn):
59 self.connectStatus = True
60

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\OpenADC.py in _con(self, sn)
245 def _con(self, sn=None):
246 if self.scopetype is not None:
–> 247 self.scopetype.con(sn)
248
249 if hasattr(self.scopetype, “ser”) and hasattr(self.scopetype.ser, “_usbdev”):

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\openadc_interface\naeusbchip.py in con(self, sn)
100 # XXX: need to comment this out?
101 try:
–> 102 self.getFWConfig().loadRequired()
103 except:
104 self.dev.dis()

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, forceFirmware)
221 def loadRequired(self, forceFirmware=False):
222 “”“Load firmware file or FPGA file only as required, skip otherwise”""
–> 223 self.loader.loadRequired(self.loadFPGA, forceFirmware)
224
225 def loadFirmware(self):

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadRequired(self, callback, forceFirmware)
135
136 def loadRequired(self, callback, forceFirmware=False):
–> 137 callback()
138
139 def loadFPGA(self):

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
248 scope_logger.info(‘FPGA: DEBUG MODE: Using .bit file, date: %s’ % strdate)
249
–> 250 self.loader.loadFPGA()
251 scope_logger.info(‘FPGA programmed’)
252

~\anaconda3\lib\site-packages\chipwhisperer\capture\scopes\cwhardware\ChipWhispererFWLoader.py in loadFPGA(self)
142
143 if self.driver.isFPGAProgrammed() == False:
–> 144 self.driver.FPGAProgram(self.fpga_bitstream())
145 else:
146 scope_logger.info(“FPGA Configuration skipped - detected already programmed”)

~\anaconda3\lib\site-packages\chipwhisperer\hardware\naeusb\fpga.py in FPGAProgram(self, bitstream, exceptOnDoneFailure)
82
83 if programStatus == False and exceptOnDoneFailure:
—> 84 raise IOError(“FPGA Done pin failed to go high, bad bitstream?”, bitstream)
85
86 return programStatus

OSError: [Errno FPGA Done pin failed to go high, bad bitstream?] <zipfile.ZipExtFile [closed]>

Can you try connecting with logging at full:

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

Alex

I attached the full log messages.

=== full log message ===
INFO:ChipWhisperer NAEUSB:Devices found: [{‘sn’: ‘44203120394d36433030312037323036’, ‘product’: ‘ChipWhisperer Lite’, ‘pid’: 44258, ‘vid’: 11070}]
INFO:ChipWhisperer NAEUSB:Devices found: [{‘sn’: ‘44203120394d36433030312037323036’, ‘product’: ‘ChipWhisperer Lite’, ‘pid’: 44258, ‘vid’: 11070}]
INFO:ChipWhisperer NAEUSB:Devices found: [{‘sn’: ‘44203120394d36433030312037323036’, ‘product’: ‘ChipWhisperer Lite’, ‘pid’: 44258, ‘vid’: 11070}]
INFO:ChipWhisperer NAEUSB:Devices found: [<DEVICE ID 2b3e:ace2 on Bus 002 Address 008>]
INFO:ChipWhisperer NAEUSB:Found ChipWhisperer-Lite, Serial Number = 44203120394d36433030312037323036
INFO:ChipWhisperer NAEUSB:Found ChipWhisperer-Lite, Serial Number = 44203120394d36433030312037323036
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 17, wValue: 0000, wIndex: 0000, data_len: 0003, response: array(‘B’, [0, 50, 0])
INFO:ChipWhisperer NAEUSB:SAM3U Firmware version = 0.50 b0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer Scope:FPGA: Builtin mode
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A0, wIndex: 0000, payload: 0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A1, wIndex: 0000, payload: 0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A2, wIndex: 0000, payload: 0
ERROR:ChipWhisperer Scope:ChipWhisperer error state detected. Resetting and retrying connection…
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 22, wValue: 0010, wIndex: 0000, payload: 0
INFO:ChipWhisperer NAEUSB:Devices found: [{‘sn’: ‘44203120394d36433030312037323036’, ‘product’: ‘ChipWhisperer Lite’, ‘pid’: 44258, ‘vid’: 11070}]
INFO:ChipWhisperer NAEUSB:Devices found: [{‘sn’: ‘44203120394d36433030312037323036’, ‘product’: ‘ChipWhisperer Lite’, ‘pid’: 44258, ‘vid’: 11070}]
INFO:ChipWhisperer NAEUSB:Devices found: [<DEVICE ID 2b3e:ace2 on Bus 002 Address 008>]
INFO:ChipWhisperer NAEUSB:Found ChipWhisperer-Lite, Serial Number = 44203120394d36433030312037323036
INFO:ChipWhisperer NAEUSB:Found ChipWhisperer-Lite, Serial Number = 44203120394d36433030312037323036
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 17, wValue: 0000, wIndex: 0000, data_len: 0003, response: array(‘B’, [0, 50, 0])
INFO:ChipWhisperer NAEUSB:SAM3U Firmware version = 0.50 b0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer Scope:FPGA: Builtin mode
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A0, wIndex: 0000, payload: 0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A1, wIndex: 0000, payload: 0
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: C1, bRequest: 15, wValue: 0000, wIndex: 0000, data_len: 0004, response: array(‘B’, [0, 0, 0, 0])
DEBUG:ChipWhisperer NAEUSB:READ_CTRL: bmRequestType: 41, bRequest: 16, wValue: 00A2, wIndex: 0000, payload: 0

Can you try replacing chipwhisperer/software/hardware/firmware/cwlite.py with an older version to
rule out any issue with the FPGA bitstream? https://github.com/newaetech/chipwhisperer/blob/c6f6d3d5ad35775cee421859da39eae19e6b6983/software/chipwhisperer/hardware/firmware/cwlite.py

Alex

I could not find chipwhisperer/software/hardware/firmware/cwlite.py file.

Thus, I replaced anaconda3/Lib/site-packages/chipwhisperer/hardware/firmware/cwlite.py with an older version.

Unfortunately, the same error occurred.

I’m not too sure what the issue is then. Out of curiosity, if you use a VM/the Windows installer, does it work then? https://github.com/newaetech/chipwhisperer/releases/tag/BHUSA2021

I tried to do firmware update at another PC, and it does not work anymore with error message. I think it was broken. Thanks for helping me.

I had this same error that I was trying to fix for a day and what I noticed is on this particular laptop, plugging the ChipWhisperer into a USB3 port gave me the error, plugging into a USB2.0 port worked just fine! No idea why.