I went through all the python/CW and the Matlab setups. The waveforms are visible in the capture GUI.
Also, the MATLAB has a valid Python environment. My working directory is also the location of the .m script files. However, cwconnect() throws some error:
cw = cwconnect()
Python Error: Invalid value
‘ChipWhisperer/OpenADC’ for parameter
‘[‘Generic Settings’, ‘Scope Module’,
‘ChipWhisperer/OpenADC’]’.
Valid values: [‘None’]
Hi debayan,
I am taking a look into it now. There is a good chance that the updating of this documentation was overlooked during the transition to cw 4.0. If that is the case I will test working steps and update the wiki documentation.
Cheers,
Franz
Thanks for your response.
Running ‘pip install chipwhisperer’ from the WinPython Command Prompt installed the v3.5 CW capture.
So, it is the CW v3.5 running with Python 2.7.10.3.
Please let me know what I should do to resolve the issue.
Since the documentation was outdated, I rewrote the tutorial and the MATLAB api for cw4.0 and updated the page. I will look into the cw3.5 issue tomorrow, then let you know when I fix it.
If you do not want to wait, you can install cw4.0 from github, there are tutorials on the wiki and the MATLAB api with 4.0 does work.
I tried to replicate your problem with cw 3.5.0 and could not, I did find a unrelated bug in measure_AES.m and fixed it.
Let me know if the cw 4.0 version of the MATLAB API fixes the issue for you.
Does running the chipwhisperer from the command line work for after you downloaded cw 4.0.? Also which version of windows are you running?
If you run this in your python console
>> import chipwhisperer as cw
>> cw.capture_gui()
What version of the capture GUI shows up (should be in the top left corner of the GUI)?
Cheers,
Franz
Hi Franz,
Thanks for your response. I am still not able to connect the CWLite with MATLAB.
I am using Windows 10 and Capture v4.0.0. The traces are also getting captured properly!
I am not able to solve the problem.
Can you please tell me the versions of the Python and CW that worked for Windows 7/10 with Matlab R2015?
Both Win 7/10 gives the same error in Matlab (as in the last reply).
Am I missing anything?
C:\Program Files (x86)\ChipWhisperer\WinPython-64bit-2.7.13.1Zero\scripts>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (
AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
This is what it shows:
C:>python
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit (
AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.
I cannot replicate this error on my system, I have been trying numerous possibilities. Chipwhisperer works with the python interpreter without matlab, and “py.importlib.import_module(‘chipwhisperer’)” does not work which bypasses the MATLAB api and manually imports chipwhisperer, which means it is most likely a different problem.
The place I have seen the "Python Error: DLL load failed: The specified procedure could not be found. " is when there is 64-bit version vs. 32-bit version problems. You could try uninstalling chipwhisperer and MATLAB and the cw example api and then reinstall everything but keep it as isolated as possible, so do not add the python included in your installation to the system path and check if your system wide python is not interfering with MATLAB paths (if you have a different python installation installed)
Also make sure everything you have installed is 64 bit, because the DLL exception usually arises when there is problem related to this. It could also be a problem with MATLAB’s api to python, I experienced a few issues with how MATLAB caches calls to the python functions (restarting MATLAB after deleting the *.pyc files usually fixed this).
It could also have to do with and issue with 2015b version that was fixed in later versions (as I am testing with 2017b). If you can it might be good to upgrade your MATLAB installation to the latest one.
Other than that I am not sure what the issue could be. I hope one of these suggestions helps you find a way to fix the problem, or at least give you a starting point on what to look for.
Thanks a lot for the response.
For capture v4.0 (with python 64bit-2.7.13.1Zero), missing DLL shows up when I run py.importlib.import_module(‘chipwhisperer’).
py.importlib.import_module(‘chipwhisperer’)
Python Error: DLL load failed: The specified procedure could not be found.
cw = cwconnect()
Python Error: ‘module’ object has no attribute ‘capture’
But, for capture v3.5 (with python 64bit-2.7.10.3), py.importlib.import_module(‘chipwhisperer’) works but cwconnect() gives an error.
py.importlib.import_module(‘chipwhisperer’)
ans =
Python module with properties:
analyzer: [1x1 py.module]
capture: [1x1 py.module]
capture_gui: [1x1 py.function]
analyzer_gui: [1x1 py.function]
hardware: [1x1 py.module]
common: [1x1 py.module]
<module ‘chipwhisperer’ from ‘E:\WinPython-64bit-2.7.10.3\python-2.7.10.amd64\lib\site-packages\chipwhisperer_init_.pyc’>
cw = cwconnect()
Python Error: Invalid value ‘ChipWhisperer/OpenADC’ for parameter ‘[‘Generic Settings’, ‘Scope
Module’, ‘ChipWhisperer/OpenADC’]’.
Valid values: [‘None’]
In both cases, I am using Matlab R2015a in Windows 10 (64 bit).
I upgraded the Matlab to R2017 and now py.importlib.import_module(‘chipwhisperer’) works properly without any error.
However, as soon as I run cwconnect(), Matlab throws a bunch of USB errors:
If you choose the second method you have bypassed the api and need to use the chipwhisper package manually as you would a python package.
I just want to make sure it is not related to you not disconnecting from the scope. Easiest way to disconnect between uses is to unplug the chipwhisperer and plug it back into the computer. Normally you would run
scope.dis()
target.dis()
When running commands you just have to be careful not to try to connect to the scope when it is already in use. More information can be found on the wiki page MATLAB 4.0 api usage
Hope this helps. If you get another error just post that. Another quick question: you are still using cw 4.0?
Cheers,
Franz