OK I found some sample script in CW 3.5.3 and it also has the schematics for the multitarget board.
Though does anyone have a sample script for 4.x?
Still struggling with settings, like what should be the clock for smartcards? Docs say somewhere between 1 MHz and 5 MHz, which is not helpful. Also not sure if it can change.
Do I use the connect_cwlite_simpleserial.py for connection or do I have to specify different target. There seems to be a separate GUI component in the sources, a descendant of TargetTemplate, but not sure how to use it.
EDIT: so after connecting to oscilloscope it seems the card reader tries 4.7 V and 3.75 MHz. Not sure though if a modern smartcard would work with 3.3V.
EDIT2: after mucking a lot with CW 3.5.3 and 4.0.4 I finally found where the option for smartcard target and settings are. But the target won’t connect:
Traceback (most recent call last):
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/capture/ui/CWCaptureGUI.py”, line 159, in doConDisTarget
if self.api.connectTarget():
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/common/api/CWCoreAPI.py”, line 288, in connectTarget
self.getTarget().con(scope=self.getScope())
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/capture/targets/_base.py”, line 66, in con
self._con(scope, **kwargs)
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/capture/targets/SmartCard.py”, line 76, in _con
self.driver.con(scope)
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/capture/targets/smartcard_readers/chipwhispererlite_scard.py”, line 134, in con
self.reset()
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/capture/targets/smartcard_readers/chipwhispererlite_scard.py”, line 144, in reset
self.atr = self.usbcon.readCtrl(self.REQ_CFG, self.REQ_CFG_ATR, 55)
File “/home/ondro/.local/lib/python2.7/site-packages/chipwhisperer-4.0.2-py2.7.egg/chipwhisperer/hardware/naeusb/naeusb.py”, line 216, in readCtrl
return self.usbdev().ctrl_transfer(0xC1, cmd, value, 0, dlen, timeout=self._timeout)
File “build/bdist.linux-x86_64/egg/usb/core.py”, line 1043, in ctrl_transfer
self.__get_timeout(timeout))
File “build/bdist.linux-x86_64/egg/usb/backend/libusb0.py”, line 593, in ctrl_transfer
timeout
File “build/bdist.linux-x86_64/egg/usb/backend/libusb0.py”, line 431, in _check
raise USBError(errmsg, ret)
USBError: [Errno None] error sending control message: Broken pipe
Tried setting the clock to 3.75 MHz, but I don’t understand why can’t I set it before connecting. But any attempt to get ATR or send APDU fails with the above message.