As of August 2020 the site you are on (wiki.newae.com) is deprecated, and content is now at rtfm.newae.com.

Difference between revisions of "V5:Installing ChipWhisperer/Required Tools - Linux"

From ChipWhisperer Wiki
Jump to: navigation, search
(Created page with "<h4> Python </h4> On Linux, installing Python & all the associated packages is straightforward. Typically you can install them from a package manager, if you are using Fed...")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<h4> Python </h4>
 
<h4> Python </h4>
On Linux, installing Python &amp; all the associated packages is straightforward. Typically you can install them from a package manager, if you are using Fedora Core or similar, just type:
+
On Linux, installing Python &amp; all the associated packages is straightforward. Typically you can install them from a package manager, if you are using Fedora Core or similar ('''TODO: Confirm these work)''', just type:
  
<pre>$ sudo yum install python27 python27-devel python27-libs python-pyside numpy scipy python-configobj pyusb
+
<pre>$ sudo yum install python3 python3-devel python3-libs</pre>
$ sudo pip install pyqtgraph</pre>
+
 
On Ubuntu or similar:
 
On Ubuntu or similar:
  
<pre>$ sudo apt-get install python2.7 python2.7-dev python2.7-libs python-numpy python-scipy python-pyside python-configobj python-setuptools python-pip
+
<pre>$ sudo apt install python3 python3-dev python3-libs python3-configobj python3-setuptools python3-pip
$ sudo pip install pyusb
+
$ sudo pip install pyqtgraph
+
 
</pre>
 
</pre>
  
Line 14: Line 11:
 
Many of the tutorials use the AVR XMEGA microcontrollers as a target. In order to compile code for these targets, you'll need the AVR toolchain. This is easy to set up:
 
Many of the tutorials use the AVR XMEGA microcontrollers as a target. In order to compile code for these targets, you'll need the AVR toolchain. This is easy to set up:
 
<pre>
 
<pre>
sudo apt-get install avr-libc gcc-avr
+
$ sudo apt-get install avr-libc gcc-avr</pre>
</pre>
+
  
 +
==== Getting the Arm Toolchain ====
 +
Many of the tutorials use the STM32F303 Arm microcontrollers as a target. In order to compile code for these targets, you'll need the GNU Arm toolchain:
 +
$ sudo apt install gcc-arm-none-eabi
 +
Some versions of Ubuntu (Ubuntu Bionic and likely before) provide a GNU Arm toolchain that links incorrect files during the build process. To install a working version of the toolchain:
 +
$ wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-dev_3.0.0.20180802-2_all.deb
 +
$ wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb
 +
$ sudo dpkg -i libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb libnewlib-dev_3.0.0.20180802-2_all.deb
 
<h4> Hardware Drivers </h4>
 
<h4> Hardware Drivers </h4>
  
Line 23: Line 26:
 
<pre># CW-Lite
 
<pre># CW-Lite
 
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace2", MODE="0664", GROUP="plugdev"
 
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace2", MODE="0664", GROUP="plugdev"
 +
 +
# CW-Nano
 +
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace0", MODE="0664", GROUP="plugdev"
  
 
# CW-1200
 
# CW-1200
Line 43: Line 49:
  
 
You can always find the latest version of this file in [https://github.com/newaetech/chipwhisperer/blob/master/hardware/99-newae.rules GIT].
 
You can always find the latest version of this file in [https://github.com/newaetech/chipwhisperer/blob/master/hardware/99-newae.rules GIT].
 
 
<h4> FTDI Hardware Driver (SASEBO-W, SAKURA-G, SASEBO-GII) </h4>
 
 
'''This is only required for supporting FTDI-connected hardware''' such as the SASEBO-W, SAKURA-G, SASEBO-GII. This is NOT required for the ChipWhisperer Capture Rev2.
 
 
First, you need to install the D2XX drivers &amp; python module. See the section [[#Optional_Packages]].
 
 
Currently, there is a bit of a hack needed. You have to create (or modify if it exists) the file <code>/etc/udev/rules.d/99-libftdi.rules</code> . The following modifications will cause '''any FTDI-serial device to stop working''', so backup the existing file! The contents of this file should be:
 
 
<pre>SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="0664", GROUP="plugdev"
 
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", RUN+="/bin/sh -c 'echo $kernel &gt; /sys/bus/usb/drivers/ftdi_sio/unbind'"</pre>
 
Then add your username to the plugdev group (if not already done):
 
 
<pre>$ sudo usermod -a -G plugdev YOUR-USERNAME</pre>
 
And reset the udev system:
 
 
<pre>$ sudo udevadm control --reload-rules</pre>
 
Finally log out &amp; in again for the group change to take effect.
 

Latest revision as of 13:06, 16 November 2018

Python

On Linux, installing Python & all the associated packages is straightforward. Typically you can install them from a package manager, if you are using Fedora Core or similar (TODO: Confirm these work), just type:

$ sudo yum install python3 python3-devel python3-libs

On Ubuntu or similar:

$ sudo apt install python3 python3-dev python3-libs python3-configobj python3-setuptools python3-pip

Getting the AVR Toolchain

Many of the tutorials use the AVR XMEGA microcontrollers as a target. In order to compile code for these targets, you'll need the AVR toolchain. This is easy to set up:

$ sudo apt-get install avr-libc gcc-avr

Getting the Arm Toolchain

Many of the tutorials use the STM32F303 Arm microcontrollers as a target. In order to compile code for these targets, you'll need the GNU Arm toolchain:

$ sudo apt install gcc-arm-none-eabi

Some versions of Ubuntu (Ubuntu Bionic and likely before) provide a GNU Arm toolchain that links incorrect files during the build process. To install a working version of the toolchain:

$ wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-dev_3.0.0.20180802-2_all.deb
$ wget https://mirrors.kernel.org/ubuntu/pool/universe/n/newlib/libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb 
$ sudo dpkg -i libnewlib-arm-none-eabi_3.0.0.20180802-2_all.deb libnewlib-dev_3.0.0.20180802-2_all.deb 

Hardware Drivers

The driver for Linux is built in, however you need to allow your user account to access the peripheral. To do so, you'll have to make a file called /etc/udev/rules.d/99-newae.rules . The contents of this file should be:

# CW-Lite
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace2", MODE="0664", GROUP="plugdev"

# CW-Nano
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace0", MODE="0664", GROUP="plugdev"

# CW-1200
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="ace3", MODE="0664", GROUP="plugdev"

# CW-305 (Artix Target)
SUBSYSTEM=="usb", ATTRS{idVendor}=="2b3e", ATTRS{idProduct}=="c305", MODE="0664", GROUP="plugdev"

# CW-CR2
SUBSYSTEM=="usb", ATTRS{idVendor}=="04b4", ATTRS{idProduct}=="8613", MODE="0664", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="221a", ATTRS{idProduct}=="0100", MODE="0664", GROUP="plugdev"

Then add your username to the plugdev group:

$ sudo usermod -a -G plugdev YOUR-USERNAME

And reset the udev system:

$ sudo udevadm control --reload-rules

Finally log out & in again for the group change to take effect.

You can always find the latest version of this file in GIT.