CW-Lite & linux

I haven’t quite got the CWlite working after an idle hour fiddling with it. I’m fully aware I’ve got one ahead of the docs and I’m being difficult and using Linux over Windows, so I’m figuring I’m just finding things ahead of time that you’re going to fix anyway.

My system: Kubuntu 15.04 amd64

I installed ubuntu packages for numpy and scipy and pip install’d the rest, and was able to run the UI. I got permission errors trying to access the chipwhisperer as user, so I created a UDEV rule:

# cat 52-cwlite.rules SUBSYSTEMS=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace2", MODE="0666"
This allowed me to run the CWCapture program, although I don’t get any example scripts in the menu - I don’t know if this is due to the hardcoded paths which are referred to in one of the python files. I can select the SimpleSerial taret and ChipWhisperer-Lite as a scope, but after correctly finding the board, and printing its serial number, it then issues a traceback due to self.usbdev not being initialised in the CWUSB_USART.

Configuring manually in the UI:

[code]Called setConnection
Traceback (most recent call last):
File “/mnt/old/widget/prog/chipwhisperer/openadc/controlsw/python/openadc/”, line 73, in change
File “/mnt/old/widget/prog/chipwhisperer/openadc/controlsw/python/openadc/”, line 664, in dcmADCLocked
result = self.DCMStatus()
File “/mnt/old/widget/prog/chipwhisperer/openadc/controlsw/python/openadc/”, line 672, in DCMStatus
result = self.oa.sendMessage(CODE_READ, ADDR_ADVCLK, maxResp=4)
AttributeError: ‘PySide.QtGui.QTextBrowser’ object has no attribute ‘sendMessage’
Found CW-Lite, Serial Number = 53313120313436373030342032313033

Target Error: [Errno 2] No such file or directory: u’’[/code]
Additionally the Project Text Editor always has an error that it can’t open “untitled.cwp” - not sure if that’s relevant.

I’ve now built from a completely blank python virtualenv with pip, and it’s worked. I’ve been able to record traces. I can’t select the Example Script but if I run it from the cmdline it works and starts the UI.

Saving the project appears to work but then “project file changed by GUI, SYNC LOST” is shown, and saving causes this error:

Traceback (most recent call last): File "/mnt/old/widget/prog/chipwhisperer/software/chipwhisperer/common/", line 182, in writeToDisk self.checkGUIChanged() File "/mnt/old/widget/prog/chipwhisperer/software/chipwhisperer/common/", line 157, in checkGUIChanged if self.project().diffWidget.checkDiff() == False: File "/mnt/old/widget/prog/chipwhisperer/software/chipwhisperer/common/", line 161, in checkDiff disk = convert_to_str(ConfigObjProj(infile=self._project.filename)) File "/mnt/old/widget/prog/chipwhisperer/software/chipwhisperer/common/", line 107, in __init__ super(ConfigObjProj, self).__init__(*args, **kwargs) File "/mnt/old/widget/prog/chipwhisperer/pyenv/local/lib/python2.7/site-packages/", line 1229, in __init__ self._load(infile, configspec) File "/mnt/old/widget/prog/chipwhisperer/pyenv/local/lib/python2.7/site-packages/", line 1318, in _load raise error configobj.ConfigObjError: Parsing failed with several errors. First error at line 1.

A trace file doesn’t appear to get generated, due to that last errror, the cwp file is only 200 bytes, with the contents:

Failed to Open File, Exception:
[Errno 2] No such file or directory: u'/mnt/old/widget/prog/chipwhisperer/software/worked.cwp'

Pressing the “Reload Editor from Disk” fixes this, somehow.

virtualenv cwenv
apt-get install libfreetype6-dev libpng-dev gfortran libblas-dev liblapack-dev
source cwenv/bin/activate
pip install matplotlib configobj numpy pyserial pyusb==1.0.0b1 pyqtgraph pyside scipy
cd software/chipwhisperer/capture
python scripts/

This worked once, and then started crashing. Unplugging the CW-lite board and plugging it back in fixed this. I don’t know if that was the problem over my distro packages?

Also I tried the git repo but I assume the openocd submodule is not public as I can’t fetch it.

Huh… I got a Linux VM up so will double-check everything still works. One thing that might be an issue - did you run the Python “ dev” for both openadc and chipwhisperer modules?

Right now they aren’t distributed via pip or anything, and I encourage people to use the “dev” option to make future updates easier (at least with git). This is the first few steps here: … pwhisperer

I had hoped to have a more streamlined Python setup before shipping out CW-Lites! But hardware happened faster than expected so am just rolling with it… there will be a new release in a few days hopefully, but that will be mostly bug fixes.

Hiya, yeah I did the dev option. Also I tried running the capture/scopes/ script which decides the FPGA isn’t programmed but can’t find a harcoded path for the bitstream (C:\E\Documents\academic\sidechannel\chipwhisperer\hardware\capture\chipwhisperer-lite\hdl\cwlite_ise\cwlite_interface.bit). I assume you’ve renamed it, as when the UI works it happily reprograms the FPGA fine.

I’ll leave playing with this for a bit and let you finish the sw - I need to read up the actual theory which is currently magic to me anyway, although I’m happy to test, break, or fix things if it will help.

Hmm… the hardcoded path is odd. It sounds like I accidentally committed the project settings file to git. You can clear all settings with a QSettings().clear() in the command line although might need to import the pyside stuff.

I’ll try to generate a VM image with everything setup as a “cheater” solution to avoid needing fancy configuration, but things should work as-is. I’ve had others running this on Linux for a while yet so I suspect I screwed something up in either git or the 0.8 release…