I am having great difficulty trying to program the CW305 target board.
I previously had a lot of trouble updating the FW on the connected Chipwhisperer Lite board,
which arrived with old FW (i.e. kept getting the message to upgrade its FW, else problems).
Well the documentation describing how to do this (e.g. using auto_program) didn’t work.
After several dozens different attempts (and dozens of crashes of the Chipwhisperer Jupyter VM),
SOMEHOW I managed to get it updated!
But now it seems like the CW305 board is also running the capture board FW, not the target FW,
and I cannot seem to get it to load the target board FW.
I believe this based upon running the following commands:
import chipwhisperer as cw
scope = cw.scope()
giving the following response:
<Traceback not shown, since it doesn't add much>
Warning: Multiple chipwhisperers connected, but device and/or serial number not specified.
Devices:
['sn = 50203120324136503130343133333034 (ChipWhisperer Lite)', 'sn =
50203120355448513230353237313038 (ChipWhisperer Lite)']
So I determined that the real ChipWhisperer Lite has the first serial number, and I assume that
the second serial number is for the CW305 board.
I tried many different techniques to write a proper CW305_SAM3UFW.bin file to the CW305
(including trying BOSSA,and program_target).
Here is an example set of commands:
import chipwhisperer as cw
import os
print(os.getcwd())
# scope = cw.scope(sn=“50203120324136503130343133333034”)
scope = cw.scope(sn=“50203120355448513230353237313038”)
# scope = cw.scope();
cw.program_target(scope, cw.programmers.AVRProgrammer, 'CW305_SAM3UFW.bin')
# programmer = cw.SAMFWLoader(scope=None)
# programmer.program("/dev/tty1", "cw305_top.bit");
# cw.program_target(scope, cw.programmers.STM32FProgrammer,
# r"../hardware/capture/chipwhispererlite/sam3u_fw/SAM3U_VendorExample/
# Debug/SAM3U_CW1173.bin")
and the response (sorry it is big):
/home/vagrant/work/projects/chipwhisperer/jupyter/archive
Traceback (most recent call last):
File “/home/vagrant/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py”, line 316, in txrx
response = self.open(serial_number=payload)
File “/home/vagrant/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py”, line 370, in open
dev.set_configuration()
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 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
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 102, in wrapper
return f(self, *args, **kwargs)
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 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
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 493, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
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’could not set config 1: Device or resource busy’
/home/vagrant/work/projects/chipwhisperer/software/chipwhisperer/common/utils/util.py:491: UserWarning: getName function is deprecated use get_name instead.
warnings.warn(’{} function is deprecated use {} instead.’.format(cc_func, func.name))
---------------------------------------------------------------------------
USBError Traceback (most recent call last)
~/work/projects/chipwhisperer/software/chipwhisperer/capture/scopes/openadc_interface/naeusbchip.py in con(self, sn)
86 #sn = None
—> 87 found_id = self.dev.con(idProduct=nae_products, serial_number=sn)
88 except (IOError, ValueError):
~/work/projects/chipwhisperer/software/chipwhisperer/capture/scopes/cwhardware/ChipWhispererLite.py in con(self, *args, **kwargs)
49 def con(self, *args, **kwargs):
---> 50 return self._cwusb.con(*args, **kwargs)
51
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in con(self, idProduct, connect_to_first, serial_number)
633
--> 634 self.usbseralizer.open(dev['sn'])
635 foundId = dev['pid']
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in open(self, serial_number)
160 cmdpacket = self.make_cmd(self.OPEN, serial_number)
--> 161 return self.process_rx(self.txrx(tx=cmdpacket))
162
~/work/projects/chipwhisperer/software/chipwhisperer/hardware/naeusb/naeusb.py in process_rx(self, inp)
153 if resp == self.ERROR:
--> 154 raise payload
155
USBError: [Errno None] None
During handling of the above exception, another exception occurred:
Warning Traceback (most recent call last)
<ipython-input-6-4a5fbb9822bf> in <module>
8 print(os.getcwd())
9 # scope = cw.scope(sn="50203120324136503130343133333034")
---> 10 scope = cw.scope(sn="50203120355448513230353237313038")
11 # scope = cw.scope();
12
~/work/projects/chipwhisperer/software/chipwhisperer/__init__.py in scope(scope_type, sn)
209 scope_type = get_cw_type(sn)
210 scope = scope_type()
--> 211 scope.con(sn)
212 return scope
213
~/work/projects/chipwhisperer/software/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
~/work/projects/chipwhisperer/software/chipwhisperer/capture/scopes/OpenADC.py in _con(self, sn)
216 def _con(self, sn=None):
217 if self.scopetype is not None:
--> 218 self.scopetype.con(sn)
219
220 self.qtadc.sc.usbcon = self.scopetype.ser._usbdev
~/work/projects/chipwhisperer/software/chipwhisperer/capture/scopes/openadc_interface/naeusbchip.py in con(self, sn)
87 found_id = self.dev.con(idProduct=nae_products, serial_number=sn)
88 except (IOError, ValueError):
---> 89 raise Warning('Could not connect to "%s". It may have been disconnected, is in an error state, or is being used by another tool.' % self.getName())
90
91 if found_id != self.last_id:
Warning: Could not connect to "NewAE USB (CWLite/CW1200)". It may have been disconnected, is in an error state, or is being used by another tool.
Setup details:
Have a current CW305 board and ChipWhisperer Lite board (bought one month ago).
Both boards are connected via USB cables to a Windows 10 Laptop, and are also connected
together using the 20 pin cable.
The commands were run using Google Chrome version 88 (running under Windows 10)
talking using port 8888 to a local VirtualBox VM running the ChipWhisperer Jupyter VM
(the “standard one” - as of Nov. 5/2020).
The CW305 S1 switches (on the back side) have M0, M1 and M2 all being 1 (ON).
The CW305 S2 switches have J16 being 0 and K16, K15 and L14 all set to 1.
The CW305 LED4 (FPGA_DONE) is solid red.
The CW305 LED5, LED6 and LED7 are all off.
By the way, the API documentation for “program_target” is as follows:
program_target
( scope , prog_type , fw_path , **kwargs )
Program the target using the programmer
Programmers can be found in the programmers submodule
Parameters
* **scope** ( *ScopeTemplate* ) – Connected scope object to use for programming
* **prog_type** ( *Programmer* ) – Programmer to use. See chipwhisperer.programmers for available programmers
* **fw_path** ( *str* ) – Path to hex file to program
BUT, I couldn’t find any description of the three programmers:
* programmers.STM32FProgrammer
* programmers.XMEGAProgrammer
* programmers.AVRProgrammer
and MOST importantly which programmer should/(MUST?) be used for the CW305 processor!
Also, I expect you MIGHT say, update your ChipWhisperer Jupyter VirtualBox VM.
I tried but was NOT successful either in finding a newer VM, NOR building one from scratch.
I will try to add a new different topic on that subject, when I can.
Thanx Barry.