Introduction
For sure to be open enough ODeV must run on Linux platform!
This page guide me to install the ODeV platform on Linux. Ubuntu 11.04 is my preferred Linux distribution due of its easy of use - I have not much expertise on Linux! :-). I download the ISO image and install it on my machine keeping all default options during the installation process. Ubuntu provides a simple graphical tool to add additional packages and the powerful shell based Advanced Packaging Tool (APT). They are very simple to use, but sometime I don't use it in order to have the latest version of a tool.
By default I install all tools in ~/Application folder in the user domain.
These are the tools I’m installing:
‣CodeSourcery GNU toolchain - version Lite 2011.03-42.
‣Java Runtime Environment.
‣OpenOCD. - version 0.5.0.
‣Versaloon driver - version 0x15.
‣Eclipse - version Helios SR2.
The ODeV Idea > ODeV - Windows Setup
Eclipse Setup
To install Eclipse in your system is as easy as to download and unzip the right distribution. Before to proceed with the installation, please note that Eclipse need some additional plug-ins to be used with demo firmware published in this site. I guide you to configure Eclipse in the Eclipse Configuration section in the main project page, but, if you prefer, you can download a configured version of Eclipse from the Download section of the site.
To install Eclipse follow these steps:
Download Eclipse from http://www.eclipse.org/downloads/.
If you don’t known witch version to download choose the Eclipse IDE for C/C++ Developers as highlighted in the following picture.
That’s all. Now go back to configure Eclipse.
Versaloon Setup
The latest step is to install the Versaloon driver and configure our Linux distribution in order to use it.
‣Verify that Versaloon is not connected to the PC.
‣Blacklist cdc_acm. cdc_acm is used by default if a CDC device is connected. But if cdc_acm is used, libusb will fail to operate Versaloon. Edit /etc/modprobe.d/blacklist.conf with root permissions by appending blacklist cdc_acm.
‣Connect Versaloon, cdc_acm will not be loaded automatically. Use the dmesg command to verify that cdc_Acm is not loaded.
> dmesg | grep '\<cdc'
‣Check that the command output is empty.
‣Now Versaloon (the hardware IF) is ready to be used to flash the MCU and debug the application, but in Ubuntu driver module can't be accessed in user mode. So I should run sudo openocd ...
‣To use Versaloon as non-root user, I configure the rules of udev:
‣Download the 60-versaloon.rules file from the Download area.
‣Copy it into /etc/udev/rules.d/ using the sudo command.
> sudo cp 60-versaloon.rules /etc/udev/rules.d
‣Replug Versaloon.
Now our Linux distribution is ready.
OpenOCD Setup
The latest stable release is the 0.4.0. Today it is quite old. The development release (0.5.0) add some interesting features like the SWD support for STM32 and the support to many new devices. At the moment I’m working with the 0.5.0 version because I tested it stable with all projects.
A precompiled version of OpenOCD (based on 0.5.0 version) is available in the site Download area. If you prefer to build it from source code, follow these steps.
NOTE: this is a general procedure to build an official OpenOCD distribution. To enable the SWD support I used the last patch and I have upgrade the VErsaloon firmware as explained by Simon Qian in this post.
There is not binary release of OpenOCD, so I need to compile it from source, but in a Linux environment this should be the rule! :-)
I need to install some development tools in order to be able to download the latest source code, compile it and install it. Lets go...
‣Open the Terminal application and type the command git. The shell notifies that git is not installed and suggests how to get it using APT.
‣Use the command apt-get to install it.
> sudo apt-get install git-core
‣Insert your password when required and follow the on screen instruction.
‣Install the build-essential package using the command sudo apt-get install build-essential.
‣Install the patch tool using the command sudo apt-get install patch.
‣Inslall the automake tool using the command sudo apt-get install automake.
‣Install the libusb-dev package using the command sudo apt-get install libusb-dev. It is needed to compile OpenOCD with Versaloon support.
‣Install the libtool package using the command sudo apt-get install libtool.
‣Install the texinfo package using the command sudo apt-get install texinfo. It is needed to build the OpenOCD documentation.
‣Install the TeX package using the command sudo apt-get install texlive. It is needed to build the OpenOCD documentation
Now I’m ready to install OpenOCD.
‣Download the source files from the SourceForge project page.
‣Extract the archive. I put it in my ~/Applications/OpenOCD folder.
‣Use these command in the terminal window to build and install OpenOCD:
> cd ~/Applications/OpenOCD/openocd-0.4.0
> ./configure --enable-vsllink
> make
> strip ./src/openocd
> sudo make install
> make pdf
‣The latest command build the documentation. The openocd.pdf file is located in the openocd/doc folder. By default Make places install the final executable in the /usr/local/bin folder.
‣Use the command openocd -v to test the installation. If openocd was built with success the current version is displayed.
Java Setup
‣Chose the Ubuntu Software Center command from the Applications menu
‣Type "Java" in the search field, check the OpenJDK Runtime 6 and press the Install button.
That’s all.
CodeSourcery Setup
‣Install the ARM EABI Lite version of the CodeSourcery G++ development tools. Download the IA32 GNU/Linux Installer. To launch the graphical installer use this command from the command line:
> sh arm-2011.03-42-arm-none-eabi.bin
‣If the error message “ERROR: DASH shell not supported as system shell” is displayed, use this command to change the shell:
> sudo dpkg-reconfigure -plow dash
‣When asked to use dah as default shell select NO.
‣Ensure that the Do not modify PATH option is selected.
‣Follow the onscreen instruction.
‣After the setup finished, you modify the PATH environment in order to make the tools (compiler, linker, etc.) available to all applications. Each Linux distribution has a set of per-user configuration files used to customize the user environment at login. Ubuntu uses the .profile file.
‣Open the .profile file in your home folder.
‣Append the following code at the end of file.
# set PATH to include the CodeSourcery arm-none-eabi toolchain.
if [ -d "$HOME/Applications/CodeSourcery/Sourcery_G++_Lite/bin/" ] ; then
PATH="$HOME/Applications/CodeSourcery/Sourcery_G++_Lite/bin/:$PATH"
fi
‣Log off to applay the changes.
That’s all.
Copyright © 2011 Stefano Oliveri
All the code is developed for test purpose and it is unsupported. The author assumes no responsibility for any damage caused by improper uses.