CW-Lite install.

Nice forum but it’s so resource heavy it’s causing Chrome on my netbook problems :wink:

I did a git clone before I read the recomendation not to. Aside from needing to install python-matplotlib I just had to follow the guide and everything worked up until trying to upload the lite firmware from within capture. "AttributeError: ‘FWLoaderConfig’ object has no attribute ‘cwliteUSB’. Is this an artifact of the git clone or my install or my system do you think?

Ubuntu ARM netbook. I’ll be trying my desktop next and I’ll use a release version before I go back to my netbook.

Windows install on XP was smooth. Winpython installed is a gig, slightly blown my mind. WinPython instructions missed out install of pyside, but obvious from errors. Used 0.1RC1 version of CW soft. Analyser seemed to work fine but crashed on close. Plugged in hardware, device announced itself as a chipwhisperer lite, driver install fine, device manager reports it’s working fine. Capture loads fine. Tried to run the example script and get

Running Script: ChipWhisperer-Lite: SimpleSerial on XMEGA* Starting User Script *****

Target Error: [Errno None] libusb0-dll:err [control_msg] sending control message failed, win error: A device attached to the system is not functioning.

Traceback (most recent call last):
File “”, line 503, in runScript
File “c:\cw\chipwhisperer-0.10rc1\software\chipwhisperer\capture\scripts\”, line 91, in run
File “”, line 767, in doConDis
File “”, line 728, in doConDisTarget
File “”, line 192, in con
File “c:\cw\chipwhisperer-0.10rc1\software\chipwhisperer\capture\targets\”, line 399, in con
File “c:\cw\chipwhisperer-0.10rc1\software\chipwhisperer\capture\targets\”, line 144, in con
self.cwlite_usart = CWLite_USART(self.usbdev)
AttributeError: ‘SimpleSerial_ChipWhispererLite’ object has no attribute ‘usbdev’

No crash when exiting capture but so far all I can get CWL to do is wink blue at me. I’ll check which driver libraries have claimed the device just as soon as I remember what program I need. I think there is a z in it.

Opening chipwhisperer-0.10RC1\software\chipwhisperer\capture\scopes\ and editing CWLiteUSB(object): to remove the serial number fetch fixes the problem in XP for me and Capture now runs the example lite script and digitises waveforms with a red flashing light. Hooray!
# Get serial number
#self.snum = usb.util.get_string(dev, 32, 3)
self.snum = 0
I have no clue why.
The first print I added caused the program to fail with the error “unexpected indent”. Python programs fail when they don’t like your formatting style? Seriously, what kind of Canadian-Irish hell are you dragging me into Colin? :wink:

ARM/Ubuntu is still not working, I have verified pyusb working by reading mouse data with code I found online. No driver seems to load as a result of connecting the device. dmesg just reports the connection. I’m assuming this is normal.

Btw. clicking on ‘Preview’ on the forum leads to a “page not found”.

Sorry on the slow responses here - have been moving this weekend which takes 5x longer than you plan :confused: Anyway quickly reading through some notes…

Nice forum but it’s so resource heavy it’s causing Chrome on my netbook problems

Ha… will have to see what I can turn off, it’s mostly some default stuff loaded!

WinPython instructions missed out install of pyside

Yeah - this changed in some recent release I think, as it used to be included I was pretty sure. But I recently resinstalled WinPython on a fresh machine and discovered this so will add to the list of dependencies.

#self.snum = usb.util.get_string(dev, 32, 3)

I think there was a change in pyusb… this is something fixed in git (or maybe I forgot to commit, I’ve got to get my lab back together still after this move!). But it’s a dumb error as the serial number isn’t really needed, but causes the error you saw.

I’m assuming this is normal.

Yeah I think so… I’ve got to double-check all that stuff on an ARM Linux though! I don’t know off-hand why it wouldn’t work.

eriously, what kind of Canadian-Irish hell are you dragging me into Colin?

Haha Python feels great once you get into it :wink:

SimpleSerial on XMEGA***** Starting User Script *****
Traceback (most recent call last):
File “”, line 503, in runScript
File “/home/alex/Desktop/CW3/chipwhisperer-0.10RC1/software/chipwhisperer/capture/scripts/”, line 79, in run
cap.setParameter([‘Generic Settings’, ‘Target Module’, ‘Simple Serial’])
File “/home/alex/Desktop/CW3/chipwhisperer-0.10RC1/software/chipwhisperer/common/”, line 582, in setParameter
self._setParameter_children(t.invisibleRootItem().child(i).param, path, value, echo)
File “/home/alex/Desktop/CW3/chipwhisperer-0.10RC1/software/chipwhisperer/common/”, line 554, in _setParameter_children
self._setParameter_children(c, path[1:], value, echo)
File “/home/alex/Desktop/CW3/chipwhisperer-0.10RC1/software/chipwhisperer/common/”, line 560, in _setParameter_children
value = top.opts[“values”][value]
KeyError: ‘Simple Serial’

If there is a way to edit posts, I can’t seem to make it work.

That’s my main error from (ARM) Ubuntu, I had it from the git version from the very first install and now still from a clean install of the 0.1RC1 zip that’s working on my windows desktop. I’ve tried using unzip from the command line to see if it made a difference (I wondered if something was screwing up filenames or paths). I think I know what a KeyError is but I have no idea how to get furthur. I don’t even know how the line that’s failing works. I don’t know how this ‘dictionary’ is being populated. Is it explicit earlier in the program or is it searching?

On trying to upload firmware to the board I still get the same error as before, but given the install can’t get 3 lines into the CWLite Simple Serial script there may be something more serious going on. I’ve checked I’m using python 2.7 and I’m now completely stuck on this platform.

The script is a bit of a hack - it basically recreates button clicks, but in this case there appears to be no Simple Serial key, which is the target. Can you try using the system manually (w/o the script?). Basically this would mean first doing this:

  1. Under ‘Scope Module’ select ‘ChipWhisperer/OpenADC’
  2. Under ‘Scope Setting’ tab select ‘ChipWhisperer Lite’
  3. Hit ‘Connect’ for the scope.

See if this far works at least! You can hit ‘Capture 1’ which will give you a trace (but not connecting to the target).

First two steps are fine. Clicking on the red dis symbol after scope to connect produces the debug log msg “Target Error:[Errno 32] Pipe error”

The error I get if the device is not plugged in is “Failed to find USB device”.

Hmm… alright, so that suggests there is some oddity on the ARM linux platform! When I get some time I’ll try and figure out what that is, I’m not 100% sure how much the libraries differ (I assumed it wouldn’t be anything major). But that is probably the root cause - it cannot connect to the CW-Lite, and the rest of the script steps fail.

I think there is more than that. On the PC I can select a target with no unit plugged in. Either simple serial or smart card. On ARM Ubuntu there are no options. This must be why there is a Key Error in the script, the options it picks are missing in the drop down menu. Also I get an error at the start “Failed to open File, Exception: [Errno 2] No such file or directory: ‘untitled.cwp’” It’s in the text efditor window and not the debug log. I’ll chase this.

I am as far as a red flashing Lite in ARM Linux, the cause of the connect failing turns out to be exactly the same as the windows bug. Namely that requesting string descriptor 0x20 appears to cause the Lite to respond with a malformed packet. This in turn instigated by pyusb having an API change between 1.0.0 beta 1 and 1.0.0 beta 2. The two operating systems then behave differently and give different errors. It would be best to change the recommended code or stress that the beta 1 must be used with RC1. Beta 2 installed automatically on my systems and I assumed there would be no problems.

The Lite’s device descriptor block lists the Serial descriptor index incorrectly as 0. It would probably be best to fix this in production devices, but moving away from a hardcoded index would break the code for devices in this state.

The not found untitled.cwp error is harmless but saving a program state as untitled.cwp prevents the program loading at all. On both Linux and Windows.

The remaining ARM Linux problems appear to be unrelated to the python version, USB or the Lite hardware.

The latest in GIT actually did fix that, and will just try to make a new release ASAP. The updated version detects the API in use, but haven’t fully tested it yet.

Woops… thanks for letting me know! Will try to fix that before too many more end up in the wild, figure out if I can make a reasonable check.

The untitled.cwp is an artifact of many improvements required to the Python code, but will try to fix that (amount other) issues.