Workshop Title - Workshop Setup Guide A1 - 1
Workshop Title - Workshop Setup Guide A1 - 1
Workshop Title - Workshop Setup Guide A1 - 1
Introduction
This document contains information for setting up an Ubuntu 12.04 host computer to run the lab
exercises of the “Introduction to Embedded Linux One-Day Workshop.”
After completing these installation steps, you will have everything needed to run the lab exercises
on your system.
Additionally, a number of steps were taken to make the environment more user friendly
(“Installing Gnome3 and Standard Scrollbars”) and to set up the lab files toolchain and target
filesystem. These comprise the three optional sections. There is no need to go through the
optional sections in order to run the lab exercises, but if you would like to know the steps that
were required to set up that portion of the lab environment, the steps are shown in these optional
sections.
The lab files that you will need to install are located on the workshop wiki page at:
http://processors.wiki.ti.com/index.php/Introduction_to_Linux_One-Day_Workshop
Chapter Topics
Workshop Setup Guide .............................................................................................................. 1-1
Installing Ubuntu 12.04 ............................................................................................................. 1-3
Installing Code Composer Studio v.5.3.0.00090 ...................................................................... 1-4
Installing Lab Files .................................................................................................................... 1-6
Configuring Ubuntu Static IP ..................................................................................................... 1-8
(Optional) Installing Gnome3 and Standard Scrollbars ............................................................ 1-9
(Optional) Installing Angstrom Cross-compile Tools ............................................................... 1-10
(Optional) Modifying Angstrom Filesystem ............................................................................. 1-12
Also, because older versions of CCS are not always archived, the exact version used in the
workshop is also available from the wiki page.
If for some reason the License Setup Wizard does not automatically launch, you can
access it via:
The location of standard header files and libraries is hard coded into the gcc and g++
executables. If you relocate them to a location other than the default as listed above, they
will not work correctly, specifically they will not be able to locate libraries without the
addition of a “—sysroot=<dir>” directive.
29. Create tools link
Open Embedded/Yocto is of necessity very organized, and reaches this organization
through the use of many layers of subdirectories. This makes the cross compiler location
a little difficult to find.
The cross-compiler build tools are not relocatable because the include headers and
libraries need to be in a specific location for the compiler to find them. A good solution
then is to create a soft link to the tools folder at a location that is easy to find, the user’s
home directory.
Note that this is all on one line and has the following two components:
/usr/local/oecore-686/i686-angstromsdk-linux/usr/bin/armv7a-vfp-
neon-angstrom-linux-gnueabi
Separated by a space from
/home/user/armv7a-vfp-neon-angstrom-linux-gnueabi
The code composer studio files that have been provided reference /home/user/armv7a-
vfp-neon-angstrom-linux-gnueabi, so if this link is left off, the projects will not build.
Note that the destination must be “.gdbinit” which is preceded with a period. The name
was used without a prepended period in the toolchain directory because files that begin
with a period are hidden.
Using “auto usb0” works well, but with the disadvantage that if no ethernet-over-usb connection is
available when Ubuntu starts up, the message “waiting on network configuration…” will appear
and will require about 2 minutes to timeout. This extra 2 minutes of boot time may be
circumvented by attaching the beaglebone so that the interface is present.
Users who dislike this 2 minute boot time may remove “auto usb0” in which case the usb0 will
have to be manually configured each time the Beaglebone is attached using “#sudo ifup usb0”
auto usb0
iface usb0 inet static
address 192.168.2.1
netmask 255.255.255.0
This section is not required for the workshop labs to work properly, but since these changes were
made on the workshop image, they are listed here.
39. Launch a terminal
40. Acquire a WAN (i.e. internet) connection
If you have already set up a static IP address as per the previous section, you can
override the static address using
ubuntu$ sudo ifdown eth0
ubuntu$ sudo dhclient eth0
41. Install gnome-shell Aptitude package
ubuntu$ sudo add-apt-repository ppa:gnome3-team/gnome3
ubuntu$ sudo apt-get update
ubuntu$ sudo apt-get install gnome-shell
The Angstrom distribution that is used in the workshop provides a set of cross-compile tools.
These can be rebuilt using the bitbake build system of OpenEmbedded.
Note that, at the time of the creation of this document, the version of gdb built in step 54 is
incompatible with the version of eclipse used in Code Composer Studio due to the deprication of
the “python printk-stack off” command as per this link:
http://stackoverflow.com/questions/14950138/eclipse-cdt-gdb-error-undefined-maintenance-set-
command-python-print-stack
While it may be possible to upgrade the eclipse support in CCS as suggested in the article, the
decision was made to instead use the cross-gdb found in the AM335x evm software development
kit, which is based on an earlier gdb version before this command was depricated.
By default the Angstrom Filesystem used in this workshop uses DHCP to acquire an IP address.
This section demonstrates using the “connman” (connection manager) utility from Angstrom in
order to set a static IP address.
The ethernet over usb gadget driver cannot be configured using connman, so a systemd startup
script is created to launch this driver at each startup. (Angstrom uses systemd instead of sysV as
its startup scripting.)
Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.06.17.img.xz
http://downloads.angstrom-distribution.org/demo/beaglebone/
The finished filesystem is provided on the workshop wiki page, but the steps are also listed here.
60. Boot the Beaglebone Black attached to a router that provides access to the wide
area network
61. Browse to the router, log in and determine the IP address of the Beaglebone Black
from the DHCP list of the router.
If you are unsure of the IP address of the router, it is usually either 192.168.1.1 or
10.0.0.1
If neither of these works, attach an x86 PC, acquire a DHCP address from the router, and
check the gateway address in your IP settings.
62. Force Ubuntu to acquire a DHCP address from the router
This is necessary assuming that you have set the Ubuntu IP address statically as per the
previous section.
ubuntu# sudo ifdown eth0
ubuntu# sudo dhclient eth0
63. From Ubuntu, create a secure shell connection to the Beaglebone Black
ubuntu# ssh [email protected]
You may be told that there is no ssh key for the connection and asked if you would like to
create one, to which say “yes.”
When you log into the Beaglebone Black, there is no password (press enter when
prompted.)
64. On the Beaglebone Black, update the opkg package manager
bbb# opkg update
65. Install connman-tests package
bbb# opkg install connman-tests
66. Change to the connman test script directory
bbb# cd /usr/lib/connman/test
67. List the currently configured connections
bbb# ./get-services
The first line of the output should list something similar to:
[ /net/connman/service/ethernet_405fc276b749_cable ]
(The hexadecimal hash following “ethernet_” will probably be different on your system.)
68. Use set-ipv4-method script to set a static IP address using the connection name
identified in step 67
bbb# ./set-ipv4-method ethernet_405fc276b749_cable manual
192.168.1.2 255.255.255.0
(note: above is single line with no carriage return.)
69. Attach the Beaglebone Black to the Ubuntu host using an ethernet crossover
cable, reset both
Note that the network cards of most modern computers will detect a crossover
configuration and automatically switch even with a standard ethernet cable.
70. Use secure shell to create a connection into the Beaglebone Black
ubuntu# ssh [email protected]
71. Change to /lib/systemd/system
bbb# cd /lib/systemd/system
72. Create file “etherusb.service” with vi editor
bbb# vi etherusb.service
Note: if you don’t want to use vi, you can use the MMC card reader to creae this file on
your Ubuntu pc using gedit.
73. Press “i” to enter insert mode
74. Enter the following into the file:
[Unit]
Description=Turn on usb0
[Service]
Type=oneshot
ExecStart=/lib/systemd/system/etherusb.sh
[Install]
WantedBy=multi-user.target