Korebot II: User Manual
Korebot II: User Manual
User manual
Version 1.6
February 2013
Documentation Author
Julien Tharin
K-Team S.A.
Z.I. Plans-Praz 28
1337 Vallorbe
Switzerland
Email: [email protected]
Url : www.k-team.com
Documentation version
Trademark Acknowledgements:
LEGAL NOTICE:
• The contents of this manual are subject to change without notice
• All efforts have been made to ensure the accuracy of the content of this manual.
However, should any error be detected, please inform K-Team.
• The above notwithstanding, K-Team can assume no responsibility for any error in this
manual.
TABLE OF CONTENTS
1. INTRODUCTION ................................................................................................. 1
1.1 HOW TO USE THIS HANDBOOK ..................................................................................... 1
1.2 SAFETY PRECAUTIONS ................................................................................................. 2
1.3 RECYCLING ................................................................................................................. 2
1.4 SPECIFICATIONS .......................................................................................................... 3
2. UNPACKING AND INSPECTION..................................................................... 4
2.1 PACKAGE CONTENTS ................................................................................................... 4
2.2 INSPECTION ................................................................................................................. 5
3. DESCRIPTION ..................................................................................................... 6
3.1 OVERVIEW .................................................................................................................. 6
3.2 KOREBOT HARDWARE ................................................................................................. 8
3.2.1 POWER REGULATION........................................................................................... 8
3.2.2 KOREBOT SERIAL AND USB SLAVE CONNECTOR ............................................... 9
3.2.3 KOREBOT RESET ............................................................................................... 12
3.2.4 KOREBOT JTAG CONNECTION ......................................................................... 12
3.2.5 KOREBOT USB HOST........................................................................................ 12
3.2.6 KOREBOT COMPACT FLASH CONNECTOR ........................................................... 13
3.2.7 KOREBOT µ -SD CONNECTOR ............................................................................. 13
3.3 KOREBOT SOFTWARE ................................................................................................ 14
4. USAGE ................................................................................................................. 15
4.1 REQUIRED HARDWARE / SOFTWARE .......................................................................... 15
4.1.1 REQUIRED HARDWARE: ..................................................................................... 15
4.1.2 REQUIRED SOFTWARE: ...................................................................................... 16
4.2 CONNECTIONS ........................................................................................................... 17
4.3 POWER-UP ................................................................................................................. 18
4.4 SOFTWARE ................................................................................................................ 22
4.4.1 INSTALLATION OF LIGHT TOOLCHAIN ................................................................ 22
4.4.2 PROGRAMMING AND LIGHT TOOLCHAIN USAGE ................................................. 26
4.5 FULL TOOLCHAIN AND SOURCES................................................................................ 32
4.5.1 REQUIRED SOFTWARE: ...................................................................................... 32
4.5.2 INSTALLATION................................................................................................... 33
4.5.3 FULL TOOLCHAIN USAGE ................................................................................... 34
4.5.4 PACKAGES INSTALLATIONS ............................................................................... 36
5. ANNEXES ............................................................................................................ 37
5.1 KB-250 EXTENSION BUS ........................................................................................... 37
5.1.1 MECHANICAL SPECIFICATIONS .......................................................................... 38
5.1.2 ELECTRICAL SPECIFICATIONS ............................................................................ 38
5.2 TOOLS AND COMMANDS ............................................................................................ 41
5.2.1 USING SERIAL PORT AND MINICOM ................................................................... 41
5.2.2 USING A WIRELESS COMPACT FLASH CARD ....................................................... 43
5.2.3 TRANSFERRING FILES USING SCP (SSH) .............................................................. 46
5.2.4 USING THE KOREUSBCAM MODULE ................................................................. 46
5.2.5 NFS CONFIGURATION ......................................................................................... 47
5.2.6 KOREBOT II CONSOLE BY WIFI AND SSH........................................................... 48
5.2.7 USING VI TEXT FILE EDITOR ............................................................................... 48
5.2.8 DEBUGGING ...................................................................................................... 49
5.2.9 DEVELOPMENT ON A VIRTUAL MACHINE ........................................................... 55
5.2.10 JAVA VIRTUAL MACHINE ................................................................................... 58
6. WARRANTY ....................................................................................................... 62
1. INTRODUCTION
1. INTRODUCTION
With this card, you will be able to create many new embedded systems by interfacing
standard devices or enhance the Khepera III robot by expanding its computing power.
Here are some recommendations on how to correctly use the KoreBot II:
• Keep the board away from wet area. Contact with water could cause malfunction
and/or breakdown.
• Store your board in a stable position. This will avoid the risks of falling, which
could break it or cause damage to a person.
• Do not plug any connectors while the board is powered on. To avoid any damage,
make all connections when the board power is off.
• Never leave the KoreBot II powered when it is unused. When you have finished
working with KoreBot II, turn it off. It will save the battery life.
1.3 Recycling
Think about the end of life of your product! Parts of the board can be recycled and it is
important to do so. By recycling you can help to create a cleaner and safer environment for
generations to come. For those reasons please take care to the recycling of your product at the
end of its life cycle, for instance sending back the product to the manufacturer or to your local
dealer.
Thanks for your contribution to a cleaner environment!
1.4 Specifications
The main specifications of the KoreBot II card are listed below:
DVD-Rom
(2) (3)
(1)
1. Korebot II card
2. Power supply cable
3. DVD-Rom with software
2.2 Inspection
The KoreBot board basic functions should be tested after unpacking. A Complete Linux
system is installed in the KoreBot flash memory. The system can be started as a standalone Linux
box, with the initial console displayed on the serial line. No application is started except the
initial shell.
The power supply and the serial connection only are necessary for the system check. The
power supply must be connected as described in section 4.2 “Connections”. The serial link
should be connected from a host computer serial port to the KoreBot board, either using a
KoreConnect extension or using a custom cable (please refer to section 4.2 “Connections” for
connection details).
The serial port should be linked to a terminal, such as minicom, on the host computer. The basic
configuration for the serial line should be:
- 115200 Bps
- 8 data bits
- No parity
- 2 stop bits
Then when switching power on, the Linux boot messages should be displayed on the
terminal (see chapter 4.3: “How to use this handbook for details”). If no character is received,
the serial line and terminal settings should be checked. If the boot is interrupted at some point,
especially during kernel uncompress step, then the system is probably corrupted. Chapter 4.4.2.2:
“Uploading the kernel and the file system: kt-boot usage” describes how to upload a new
system to the board. If the boot process is completed to the login prompt, then the boot messages
should be checked for errors, please refer to chapter 3.3: “Korebot Software” for further
information on the KoreBot Linux system.
3. Description
3.1 Overview
An overview of the KoreBot hardware is depicted in the Figure 3-1 and Figure 3-2. The
locations of various key elements are indicated for later references. The compact flash slot can
receive a Type I card.
The KB-250 extension bus connectors are used to plug in KoreBot extensions. Please visit
http://www.k-team.com for a list of available extensions. All the other connectors are described
in the subsequent part of this chapter.
The USB Host connector is a Mini-AB USB On-The-Go connector. USB peripherals can be
connected to KoreBot with this connector.
Warnings:
The KoreBot power supply system is not designed to support Compact
Flash card hot plug. Inserting or removing a card when the power is switched on
can cause critical damage to the Compact Flash electronic interface.
Power supply connector USB host connector Reset button Serial connector
On/off LED
KB-250
Extension
connector
KB-250
Extension
connector
Compact flash connector Micro-SD connector
The KoreBot is designed so that unregulated power sources, such as batteries, can be directly
connected to supply the board without any external regulation required. One embedded
regulators is provided to enable any voltage source between 3.3V and 5.5V. Please notice that
Wrong power connections can cause critical damage to the board.
A ground reference is common for the entire board. The power source must be connected to
the correct input to supply the board. When using the high voltage input, the first regulation stage
provides regulated 5V and supplies the second regulation stage. The second regulation stage,
which cannot handle input voltage over 5.5V, provides regulated 3.3V and the processor core
supply. When using the low voltage input, it is directly connected to the second regulation stage.
The board will be fully functional as long as the input is over 3.3V. The CPU core can still run
with an even lower input, but the 3.3V supply will fall and the board peripherals will stop
functioning.
A low voltage supply connection is displayed on Figure 3-3. Only two of the three power
connections are used at the same time. The power cable included with the KoreBot package has
three connections be careful to connect the board power properly to avoid damage.
ground
do not connect
3.3-5.5 V
The KoreBot serial connector provides signals for several interfaces. The board itself is too
small to include standard serial or USB connectors, but it can be easily extended using a
KoreConnect extension or with any setup suitable for a custom application.
The serial connector provides two serial interfaces, one USB slave and a regulated 3.3V power
connection. Figure 3-4 shows details for the pins function.
The regulated 3.3V power pin can supply external electronic devices such as a RS2332
transceiver. KoreBot regular extensions should use the KB-250power pins as a supply source.
Please refer to the Electrical Specification for further details.
The third serial port (Bluetooth UART) is only available on the KB-250 extension bus.
Additional signals, such as RS232 control signals are also provided on this bus. Special
applications may need to use the KB-250 connection for special requirements, please refer to the
“Intel PXA270 Developer Manual” for a detailed description of the various serial ports features
and capabilities.
When the KoreBot is connected without using a KoreConnect extension, a flat cable is
provided to create a custom cable connection. The flat cable pin functions are described on
Figure 3-5. Special care should be taken for USB connections, as these signals are quite
sensitive.
Signals from the main serial interface (Full UART) are RS232 compatible signals, a serial
cable from a PC can be directly connected without any other requirement. On the other hand,
signals from the second serial interface (IrdDa UART) are TTL signals and an external RS232
transceiver is required for a communication with a host computer. When using a KoreConnect
extension, the transceiver is provided within the extension, so that both serial connectors are
RS232 compatible.
Figure 3-6 shows how to connect a DB9 connector to the KoreBot serial connector. This
connection to the first serial line will allow an easy link to a Personal Computer and a virtual
terminal. This is by default the channel used for the Linux initial console and it is required for the
fisrt interactions with the system.
Up to now, the PXA270 CPU doesn’t support USB slave correctly. Then it is not
implemented here.
The KoreConnect extension provides a simple interface to standard cables and connectors
from a personal computer to the KoreBot. Two standard DB9 serial connections and a standard
USB type B connection are provided to interface the first two KoreBot serial ports and the
KoreBot USB slave port. Furthermore, a RS232 transceiver will convert TTL signals from the
second serial port to high voltage signal required for a direct connection to a PC.
KoreConnect is not included with the Korebot standard package and needs to be purchased
separately. Figure 3-8 displays how to connect the KoreBot to a PC to get the initial boot console
from the serial port 0.
The KoreBot reset chain can be triggered by pressing the reset button (see Figure 3-1,
Figure 3-9).
When pressing the reset button, the board core supply and 3.3V regulator is actually shut
down and the Pxa-Reset pin is held low, ensuring a proper restart from safe state. The Pxa-Reset-
Out pin is also held low by the CPU, so that all the other devices on the board are reset. On
button release, the regulator itself manages to wait until the power regulation is stable before
releasing the Pxa-Reset pin high. Then the Pxa complete its reset sequence before releasing the
Pxa-Reset-Out pin that is connected to all the other resettable devices on the board.
When driving the Pxa-Reset pin low from an external device, the processor is reset, and it
drives the Pxa-Reset-Out pin low to reset other devices. The Pxa-Reset-Out pin is not released
until the processor reset sequence is completed. The only difference between the two methods is
that the regulator is not shut down.
The JTAG connector is a direct connection to the Pxa270 JTAG debug port. This interface
enables online debugging and memory access from a host computer using the KoreJTAG
extension or any compatible JTAG hardware. Figure 3-9 is a pin description for the JTAG
connector.
The KoreBot provides one USB host. It is available from the mini-USB connector (see fig
3-9). The USB Host interface provides a way to connect USB devices, such as webcams or
external disks, to the KoreBot. Plug the device when the Korebot is on and it will be detected and
mounted for storage devices. See with mount command.
Example: mounted on directory /media/hdd for USB key. Unmount it with command
umount /media/hdd before unplugging the storage device.
You can connect any compact flash, Type I card to this connector.
WARNING : The system does not support hot-plug. Switch off the Korebot before
adding or removing any Compact Flash card!
The µ-SD and the Compact flash are on the same bus. Then you cannot
use both together.
For using a Compact flash memory card (shipped in that mode by default):
2) Uncomment by adding # at the beginning of the line or add if not present the pcmcia
and pxa2xx_cs modules
3) Switch off the Korebot; insert the Compact flash card; and switch on.
=> You can copy files to and from the card at the location /media/hda
See chapter 5.2.2: “Using a Wireless compact flash card” for wireless compact flash settings.
With the µ-SD connector and a µ-SD card, you can easily transfer files to and from the
Korebot.
WARNING: The µ-SD and the Compact flash are on the same bus. Then you
cannot use both together.
By default the Compact flash is activated. To change the activated card, you have to edit
the /etc/modules file as follow:
2) Uncomment by adding # at the beginning of the line or add if not present the
mmc_block and pxamci
=> You can copy files to and from the card at the location /media/card
4. Usage
Required files:
• Linux OS (kernel 2.6.x) on the computer with the following packages installed:
gcc : GNU C compiler
minicom : terminal emulation
lrzsz : communication package
picocom : minimal dumb-terminal emulation
program
expect : interactive scripts running program
1
20090416 means the version of this software.
4.2 Connections
The basic connections of the board are depicted in Figure 4-1. The power supply is
connected to the board with the power cable. And the serial cable is connected to the computer
through the KoreConnect adapter. If there is no serial port, you may use an usb to serial adapter.
A low voltage supply connection is displayed on. Only two of the three power connections
are used at the same time. The power cable included with the KoreBot package has three wires
with bare ends:
o Red : DC 3.3-5.5 V
o Black : ground
o Yellow : not used
You should be careful when connecting the board power properly to avoid damage.
* *
* *
*
Serial cable, KoreConnect, KoreConnect cable, power supply and computer are obviously not
included.
4.3 Power-up
Follow the instructions below to connect to the Korebot with the serial port.
1) Install the Linux package lrzsz containing communications programs. If your Linux
distribution is Ubuntu:
sudo apt-get install lrzsz
If Minicom is not installed you have to install this package. For Linux Distribution
“Ubuntu”, the command is:
sudo apt-get install minicom
3) Set its parameters with the sub-menu “Serial port” setup of the menu [configuration]
(keys Ctrl-a + o) as described in Figure 4-2.
You may modify the serial port device name depending where you plugged your serial
port (see chapter 5.2.1 “Using serial port and Minicom”).
If you use a serial to USB adapter, the serial device may be /dev/ttyUSB0.
+-------------------------------------------------------------+
| A - Serial Device : /dev/ttyS0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-------------------------------------------------------------+
Save the settings with the command “Save setup as dfl” of the menu [configuration] (cf
Figure 4-3).
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
4) Connect the Korebot as described in chapter 4.2. And connect the power supply to
the Korebot and switch it on. The Korebot will boot and the prompt will be available:
see Figure 4-4.
.
.
.
korebot2 login:
=> You are at the prompt of the Linux console of the Korebot (see Figure 4-5).
Welcome to Korebot2!
root@korebot2:~$
4.4 Software
The following sub-chapters explain the software installation and the application
development with the board.
• Light toolchain
• Full toolchain and sources: for advanced users; kernel modification; packages
creation/addition
In the subsequent paragraphs, only the light tool chain is explained. The full toolchain is
described in a following chapter.
The installation of the software required to use the board and the development tool is
described in the next sub-chapters.
Below are listed the files needed to install the light toolchain. These files are included in the
DVD-ROM of the package or from the Internet url: http://ftp.k-team.com/KorebotII/software/
The development directory will be the base folder for your development. It contains links
and scripts to easily use the cross-compiler to make your programs.
1) Extract the file development_k2_v1.0.tar.bz2 in your home directory and enter in the
directory development_k2_v1.0 created just before, which will be your development
directory. You can use the following commands, assuming you are in a console,
which current directory contains the file:
tar -xjf development_k2_v1.0.tar.bz2 -C ~/
cd ~/development_k2_v1.0
2) Modify the KTEAM_HOME variable in the file env.sh to point to your development
directory: replace YOUR_USERNAME by your Linux account name. You can use vi
text editor (see chapter 5.2.7 “Using vi text file editor”):
KTEAM_HOME=/home/YOUR_USERNAME/development_k2_v1.0
3) You can check if the installation is correct by running the cross-compiler. Firstly
make the environment variables available then check the version of the cross-
compiler:
source env.sh
arm-angstrom-linux-gnueabi-gcc --version
The library is already installed on the Korebot. See chapter 4.4.1.5 for a reinstall or update.
To install the library on your development system, follow the following instructions:
3) You can recompile the whole library by running the following commands in the
libkorebot-1.19-kb1 folder:
source ../env.sh
make clean
make
On the Korebot II, there are 3 ways to check the version of the installed libkorebot (only the
last one works if the library version is <1.17):
- Command: ipkg list_installed | grep libkorebot
- Command: ls –l /usr/local/libkorebot*
- Transfer to the Korebot II the template program from the libkorebot/template (chapter
4.4.2.1) and execute it with the parameters: ./template --kb-version 0
For libkorebot version >= 1.17: ./template --version or ./template -v
You can find an updated version of the libkorebot from the following ftp site:
http://ftp.k-team.com/KorebotII/software/common/libkorebot/
4.4.1.4 Installation of the scripts for uploading the kernel and the file system:
ktboot
With these scripts, the Korebot can be reinitialised to its default settings.
=> For usage, see chapter 4.4.2.2: ”Uploading the kernel and the file system: kt-boot usage”.
The library is already installed on the Korebot. For an update, download the new version at
the site below and transfer it to the Korebot:
http://ftp.k-team.com/KorebotII/software/common/libkorebot/
You can start your code into the template program and use the following commands to
build it. The first one makes the environment variables (path to the cross-compiler, libraries)
available to the system and the second run the Makefile script to compile and build the
executable program. Enter in the libkorebot-1.19-kb1/template folder and type in a console to
build the template program:
source ../../env.sh *
make
You can transfer the program to the Korebot by serial (see chapter 5.2.1 ”Using serial port and
Minicom”) or wireless connection (see chapters 5.2.2 and 5.2.3).
The Application Programming Interface (API) documentation of the library is available in the
libkorebot directory under doc/html/index.html or there:
http://ftp.k-team.com/KorebotII/software/common/libkorebot/api/html/index.html
You can find programming examples in the sub-directory src/tests of the libkorebot library.
You can debug your program with the instructions in the chapter 5.2.8.
Remarks:
If you modify the program name, you will have to modify its occurrences in the
Makefile file.
* You need to source the env.sh file every time you open a new console when you
want to program, to give access to the cross-compiler.
4.4.2.2 Uploading the kernel and the file system: kt-boot usage
The kt-boot allows to upload to the Korebot the kernel and file system if it was
erased/corrupted or if a new is available or compiled with the full toolchain (see chapter 4.5,
”Full toolchain and sources”).
WARNING: All the data on the Korebot will be lost after running the following
instructions!
Remarks: If the full toolchain is installed, the kernel and file system will be taken from the
toolchain directory by default and no more from the kt-boot directory! See the
Makefile file in the kt-boot directory for details.
2) Edit the script picocom in your development directory to match your serial port
connection (/dev/ttyS0 by default) and run it:
./picocom
3) Reboot the KoreBot, then press a key when U-Boot asks for autoboot (see Figure
4-6).
DRAM: 128 MB
Flash: 32 MB
Using default environment
5) Then change directory to ktboot, edit the Makefile (with vi editor (see chapter 5.2.7
“Using vi text file editor”) and modify the variable to match your serial port:
SDEV = /dev/ttyS0
See chapter 5.2.2 : “Using a Wireless compact flash card” for the description and usage.
By default, only the standard C library (libc) is installed on the Korebot II. If you want use
C++ compiled program, you will have to install the C++ library (libstdc++). It is available on the
DVD or here as a package:
http://ftp.k-team.com/KorebotII/software/common/libstdc++6_4.1.2-r10_armv5te.ipk
Transfer this file to the Korebot and install it with the command:
ipkg install libstdc++6_4.1.2-r10_armv5te.ipk
You can use also Eclipse as source code editor. See instructions below how to install and
use it.
2) Download the linux version of "Eclipse IDE for C/C++ Developers (includes
Incubating components)" from (for Ubuntu users, don't install with apt-get because,
the apt-get version is older):
http://www.eclipse.org/cdt/
4) You should have installed the latest version of the Korebot 2 toolchain (light or full).
Copy the debugger program file:
http://ftp.k-team.com/KorebotII/software/common/debug/arm-angstrom-linux-gnueabi-gdb
to /usr/local/korebot2-oetools-1.0/tmp/cross/bin on your computer with the command
(one line):
wget http://ftp.k-team.com/KorebotII/software/common/debug/arm-angstrom-
linux-gnueabi-gdb -P /usr/local/korebot2-oetools-1.0/tmp/cross/bin
You can check by opening a terminal and sourcing the Korebot 2 environement with
"source env.sh" (see Korebot " User Manual", chapter 4.4.2.1, command
arm-angstrom-linux-gnueabi-gdb --version
which should return: GNU gdb (GDB) 7.0
5) Run eclipse and at the "Workspace launcher" window, choose where you would like
to put your project.
6) Go to file menu “File => C Project” (or C++; for running a C++ on the Korebot 2, you
must install the standard C++ library:
http://ftp.k-team.com/KorebotII/software/common/libstdc++6_4.1.2-r10_armv5te.ipk
with the command ipkg install libstdc++6_4.1.2-r10_armv5te.ipk on the Korebot 2) and
choose a Project Name (ex: test).
7) In the next window "C Project", push the "Advanced Settings" button and on the
“C/C++ Build => Discovery Options”,
for c: On 'GCC C Compiler' change 'Compiler invocation command' to
'/usr/local/korebot2-oetools-1.0/tmp/cross/bin/arm-angstrom-linux-gnueabi-gcc'
or (depending if your project is C or C++)
for c++: On 'GCC C++ Compiler' change 'Compiler invocation command' to
'/usr/local/korebot2-oetools-1.0/tmp/cross/bin/arm-angstrom-linux-gnueabi-g++'
12) On “Cross GCC Linker => Libraries” at "Libraries (-l), add korebot with the + button
on the upper right.
15) Choose “C/C++” Build menu at the left, “Discovery options” repeat the steps above
from 7) for the Release configuration.
17) Go to menu “File => New => Source file” choose test.c as filename
18) Close the Welcome window with its cross at the upper left.
#include <korebot/korebot.h>
return 0;
}
20) Then cross-compile the project with menu “Menu Project => Build-All”
=> The output file will be in the subdirectory Debug or Release of the project.
21) Transfer the file "test" to your Korebot 2 (see chapter 5.2.3).
Remarks: Prior knowledge of Linux, its kernel and Open Embedded tools is highly
recommended.
Required files:
• Linux packages
g++ : GNU C++ compiler
patch : patch software
help2man : manual converter
diffstat : reads the output of diff and displays a
histogram
texi2html : convert to html
makeinfo : produce doc (texinfo on Ubuntu)
ncurses-dev : library allowing the programmer to
write (libncurses5-dev on Ubuntu)
cvs : revision control system
gawk : programming language designed for processing text-
based data
python-dev : dynamic object-oriented programming language
python-pysqlite2 : Python sql interface
subversion : version control system
On Ubuntu Linux distribution, you can use the following command to install all the
above packages in one time:
sudo apt-get install g++ patch help2man diffstat texi2html texinfo libncurses5-dev
cvs gawk python-dev python-pysqlite2 subversion
4.5.2 Installation
4) You can check if the installation is correct by running the cross-compiler. Firstly
make the environment variables available then check the version of the cross-
compiler:
source env.sh
arm-angstrom-linux-gnueabi-gcc -version
6) Install the scripts for upload the file system and the kernel; see chapter 4.4.1.4:
“Installation of the scripts for uploading the kernel and the file system: ktboot”.
To rebuild the toolchain system, the image file and the kernel, execute the following
instructions:
2) With the following commands you can build/rebuild the whole system:
o Cleaning : bitbake -c clean korebot2-image
• Gumstix documentation:
o http://www.gumstix.org/
o http://wiki.gumstix.org/index.php?title=Main_Page
You can modify the kernel here by accessing to its menu with these commands:
source extras/profile
Then you rebuild it and the file system by executing these commands at the root of the
korebot oetools (/usr/local/korebot2-oetools-1.0):
source extras/profile
and before rebuilding the kernel, you have to copy the config file:
cp \
/usr/local/korebot2-oetools-1.0/tmp/work/gumstix-custom-verdex-angstrom-linux-
gnueabi/gumstix-kernel-2.6.24-r1/linux-2.6.24/.config \
/usr/local/korebot2-oetools-1.0/user.collection/packages/linux/gumstix-kernel-
2.6.24/gumstix-custom-verdex/defconfig
bitbake korebot2-image
You can now upload the files to the Korebot with kt-boot (see chapter 4.4.2.2: “Uploading
the kernel and the file system: kt-boot usage”).
With OpenEmbedded, you can easily cross-compile existing packages or add your own.
Many packages are available for Open-Embedded. Here below are the instructions to add an
existing package:
bitbake PACKAGE_NAME
4) Transfer the package to the Korebot (with Minicom or ssh; see chapter 5.2.1.2 ”To
send a file to the Korebot (upload)”).
You can list installed packages on the Korebot II and find your PACKAGE with the command:
ipkg list_installed | grep PACKAGE
You can create new packages for the Korebot, following the instructions there:
http://www.gumstix.org/software-development/open-embedded/160-bitbake-tutorial.html
5. Annexes
Korebot extension
Female connector:
Ref: ERNI – SMC 124045
Korebot II
Male connector:
Ref: ERNI – SMC 063210
Female connector:
Ref: ERNI – SMC 124045
Overview
You can use Minicom program on Linux and Teraterm on PC for connecting to the Korebot and
also for sending and receiving files.
The instructions below are for Minicom, but can be adapted for Teraterm as some hints are
given. Teraterm can be downloaded from there: http://en.sourceforge.jp/projects/ttssh2/releases/
2) Install the Linux package lrzsz containing communications programs. If your Linux
distribution is Ubuntu:
sudo apt-get install lrzsz
1) Set its parameters with the sub-menu “Serial port” setup of the menu [configuration]
(Figure 5-7) (keys “Ctrl-a + o”) as described in Figure 5-6. You may modify the
serial port device name depending where you plugged your serial port. If you use a
serial to USB adapter, the serial device may be /dev/ttyUSB0.
+-------------------------------------------------------------+
| A - Serial Device : /dev/ttyS0 |
| B - Lockfile Location : /var/lock |
| C - Callin Program : |
| D - Callout Program : |
| E - Bps/Par/Bits : 115200 8N1 |
| F - Hardware Flow Control : No |
| G - Software Flow Control : No |
| |
| Change which setting? |
+-------------------------------------------------------------+
Save the settings with the sub-menu “Save setup as dfl” (Figure 5-7).
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
+--------------------------+
1) In the Minicom console, hold the keys “Ctrl + a” and press “s” and select “Z-
Modem”.
2) Select the file you would like to upload to the Korebot (navigate with the arrows keys,
2x “spacebar” to change directory and “spacebar” to select the file).
Select [Okay] to send it.
For Teraterm, choose menu File, then Transfer, Z-Modem and Send.
1) In the Minicom console at the prompt of the Korebot, type the following command,
where FILENAME is the file you would like to send.
lsz FILENAME
The file FILENAME is sent to the last directory Minicom used (or if not changed,
where it started).
For Teraterm, run the command lsz FILENAME then choose menu File, then
Transfer, Z-Modem and Receive. The file will be in the directory given by menu File,
“Change directory”.
Two wireless compact flash models are supported. The card name and its driver are listed below:
Remark:
The following instructions are for the wireless compact flash B) WL5400G-CF.
With the model A) Ambicom WL1100C-CF, you have to instruct the driver to ignore
Vcc differences by setting module parameter ignore_cis_vcc=1
either in /etc/module : put hostap_cs ignore_cis_vcc=1 before the line:
### update-modules: start processing /etc/modutils/pcmcia
or for testing, by manually loading the module with 'modprobe hostap_cs
ignore_cis_vcc=1' before inserting the card.
Then you have to replace the wireless port name eth0 by wlan0 in the following
instructions.
Modify the file /etc/network/interfaces with your wireless network settings with vi editor
(see chapter 5.2.7 “Using vi text file editor”):
#
# Wireless interfaces
#
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
wireless_mode managed
wireless_essid YOUR_SSID_OF_NETWORK
address YOUR_IP_ADDRESS
netmask YOUR_NETMASK
gateway YOUR_GATEWAY_IP
/**********************************************/
ii) WEP encryption support
a) for configuring the wifi connection, type:
iwconfig eth0 essid YOUR_SSID_OF_NETWORK
You can also create a file in /etc/network/if-pre-up.d named wireless to have these
settings saved.
#!/bin/sh
ifconfig eth0 up
iwconfig eth0 essid YOUR_SSID_OF_NETWORK
iwconfig eth0 key s:YOUR_KEY
ifconfig eth0 YOUR_IP_ADDRESS
route add default gw YOUR_GATEWAY_IP eth0
And make it executeable with the command:
chmod +x /etc/network/if-pre-up.d/wireless
search YOUR_LOCAL_DOMAIN_NAME
nameserver YOUR_DNS_SERVER_IP_ADDRESS
WEP:
#Shared WEP key connection (no WPA):
network={
ssid="YOUR_SSID"
key_mgmt=NONE
wep_key0="YOUR_WEP_KEY"
auth_alg=SHARED
wep_tx_keyidx=0
priority=5
}
WPA-TKIP:
#/etc/wpa_supplicant/wpa_supplicant.conf
#with WPA-PSK TKIT:
network={
ssid="YOUR_SSID"
psk="YOUR_PASS_KEY"
key_mgmt=WPA-PSK
group=TKIP
pairwise=TKIP
proto=WPA
priority=5
}
b) run the daemon controlling the wireless connection with the following command:
wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -ieth0 -Dwext -B
c) In /etc/network/if-pre-up.d named wireless, add the following commands:
#!/bin/sh
ifconfig eth0 up
ifconfig eth0 YOUR_IP_ADDRESS
route add default gw YOUR_GATEWAY eth0
pre-up wpa_supplicant -c/etc/wpa_supplicant/wpa_supplicant.conf -ieth0 -Dwext –B
post-down killall -q wpa_supplicant
d) reboot the system or restart the network with the following command:
/etc/init.d/networking restart
1) Establish a network connection between the computer and the Korebot (for using
wireless, see chapter 5.2.2 ”Using a Wireless compact flash card”).
You can connect the KoreUSBCam and use it as described in the user manual available at the
link below.
You don’t need to install the driver, as it is already included for the Korebot II.
• User manuals:
Current KoreUSBCam:
http://ftp.k-team.com/korebot/koreusbcam/KoreUSBCam_QuickUserManual_v1.0.pdf
Old KoreUSBCam:
http://ftp.k-team.com/korebot/koreusbcam/KoreUSBCam_UserManual_v1.2.pdf
You can use the following programs compiled for the Korebot II:
Remark: the camera module focus is manual only. No autofocus mode is available.
The first service to set up should be transparent file sharing using NFS. Most Linux
distributions include NFS support by default, and the KoreBot system is ready to be connected.
The directory to be shared between the computer and the board must be declared to the NFS
service in the /etc/exports configuration file. Please refer to NFS documentation, or man exports,
for a detailed syntax description. Basically, the following line should be added to the file
/etc/exports on the computer:
/mnt/nfsarm KOREBOT_IP/255.255.255.0(rw,no_root_squash,sync)
And this directory should be created on the computer with: mkdir /mnt/nfsarm
Then the export should be refreshed with the command: exportfs –av
The next step is to mount the shared directory to the KoreBot file system. Mounting a local
hard drive partition or a network directory is exactly the same from the user point of view, the
mount commands should be on the Korebot, where COMPUTER_IP, is the IP address of the
computer which the Korebot will be connected:
mkdir /mnt/nfs
Caution: For the nfs service to work properly, the portmap service should be started as well and
if a firewall is active on the host machine, it should be configured to allow the nfs port
access from the KoreBot.
Once the directory is successfully mounted, it can be accessed from the board exactly as if it was
a local directory. Files on the PC can be read or written, new files can be created, and programs
can be executed, as long as they are ARM executables. If required, the shared directory can be
unmounted using the command:
umount myMountPoint
You can connect to the KorebotII also by wireless. Execute the following
command in a Linux terminal or use your favorite ssh program (Tera Term on Windows):
ssh root@KOREBOT_IP
where KOREBOT_IP is the Korebot ip address.
At the password prompt, just press the RETURN key (no password). You will have a
terminal that is the Korebot II console.
You can use the installed vi text file editor to modify files directly on the Korebot.
i enters in write mode for adding text. You will see the I indicating this modeat
the last line of the file: I /tmp/essai 1/1 100%
a enters in write mode for adding text. You will see the I indicating this modeat
the last line of the file: I /tmp/essai 1/1 100%
5.2.8 Debugging
You can debug a program you made directly in console on the Korebot II or remotely.
The files can be found here:
http://ftp.k-team.com/KorebotII/software/common/debug/
• You need firstly to install the following packages with the commands in that order:
ipkg install ncurses_5.4-r9_armv5te.ipk
• Then your program must be cross-compiled with the option –g . Edit your Makefile and
replace the flag -O2 by -g .
• Copy to the Korebot II the compiled program and its source file.
• And run for debugging it:
gdb YOUR_PROGRAM
You need firstly to install the following packages with the commands:
ipkg install libthread-db1_2.9-r37.4.6_armv5te.ipk
ipkg install gdbserver_7.0-r2.0.5_armv5te.ipk
• Then run the gdbserver with your cross-compiled program, the computer host ip and a
unused port number as argument:
/usr/local/korebot2-oetools-1.0/tmp/cross/bin
http://ftp.k-team.com/KorebotII/software/common/debug/
• Unpack and copy the libexpat files to that directory (with sudo) from the link below:
http://ftp.k-team.com/KorebotII/software/common/debug/
• Create the links with the following command (in one line each):
sudo ln -s /usr/local/korebot2-oetools-1.0/tmp/staging/i686-
linux/lib/libexpat.so.0.5.0 /usr/local/korebot2-oetools-1.0/tmp/staging/i686-
linux/lib/libexpat.so.0
sudo ln -s /usr/local/korebot2-oetools-1.0/tmp/staging/i686-
linux/lib/libexpat.so.0.5.0 /usr/local/korebot2-oetools-1.0/tmp/staging/i686-
linux/lib/libexpat.so
You can use the debugger in command line or with ddd GUI:
Command line:
• Execute for running the debugger in the computer:
arm-angstrom-linux-gnueabi-gdb YOUR_PROGRAM
• In this debugger, set parameter and connect to the remote gdb with the 2 commands:
set sysroot /usr/local/korebot2-oetools-1.0/tmp/staging/arm-angstrom-linux-gnueabi
target extended-remote YOUR_KOREBOT_IP_ADDRESS:1234
The commands (r,…,h) are the same as for gdb in chapter 5.2.8.1.
With GUI:
• On your computer, install ddd the debugger GUI with :
sudo apt-get install ddd
• Launch ddd with:
ddd --debugger arm-angstrom-linux-gnueabi-gdb YOUR_PROGRAM
• In the window at the bottom where the (gdb) prompt is run these 2 commands:
set sysroot /usr/local/korebot2-oetools-1.0/tmp/staging/arm-angstrom-linux-gnueabi
target extended-remote YOUR_ KOREBOT_ADDRESS:1234
The sequence of debugging and also the commands are the same as described above in chapter
5.2.8.1.
You can even send your program to the remote (Korebot II) with the gdb commands:
remote put hostfile targetfile
set remote exec-file targetfile
where hostfile and targetfile is the same name of your new program to be
debugged.
For quitting the debugger and remote, execute commands monitor exit, then disconnect and
finally quit .
make clean
make DEBUG=1
You can also debug remotely your program with Eclipse (see chapter 4.4.2.5 for a proper
installation). Follow instructions below:
2) From http://ftp.k-team.com/KorebotII/software/common/openssh ,
openssh-scp_4.6p1-r3_armv5te.ipk
openssh-ssh_4.6p1-r3_armv5te.ipk
openssh-sshd_4.6p1-r3_armv5te.ipk
openssh_4.6p1-r3_armv5te.ipk
openssh-sftp-server_4.6p1-r3_armv5te.ipk
openssh-sftp_4.6p1-r3_armv5te.ipk
4) Connection with SSH connection will be dropped in the middle then connect with
serial port to the Korebot 2.
5) Install these openssh packages in that order. The command for each is
ipkg install PACKAGE.ipk
openssh-scp_4.6p1-r3_armv5te.ipk
openssh-ssh_4.6p1-r3_armv5te.ipk
openssh-sshd_4.6p1-r3_armv5te.ipk
openssh_4.6p1-r3_armv5te.ipk
openssh-sftp-server_4.6p1-r3_armv5te.ipk
openssh-sftp_4.6p1-r3_armv5te.ipk
6) With this new openssh server, a password is needed: run this command and create a
new password: passwd
8) Remove on your computer the known host (as the ssh server changed the security key
changed): rm ~/.ssh/known_hosts
9) On Eclipse menu 'Run' => Debug Configurations' , double click on 'C++ Remote
Application'
11) On “Connection”: push “New” button and choose “SSH”, in the next window,
Hostname: ip address of your korebot 2 and push “Finish” button.
12) On "Remote Absolute File Path for C/C++ Application" modify to /home/root/test
16) Then Push Debug, enter root as "User ID" and use the password created above at
point 6)
You can go again into the settings, and select "Release" configuration when your program has
been fully debugged.
You can run the program from the korebot2 (with a remote terminal) or with Eclipse GUI.
After having set the Debug configuration, the parameters are also available for the run.
In the lower part of the Eclipse window, you will see the output of your program in the Console
tab.
Files needed:
- VirtualBox installed (from http://www.virtualbox.org/)
Hardware needed:
- computer with at least 2GB of RAM and 4 GB of free disk space
- You may configure the serial port for using the KoreConnect to connect to the Korebot II.
- Select the "Ubuntu-KorebotII" machine and press "Settings" button.
- Go to "Serial Ports" settings
- On the tab "Port 1", enable the checkbox "Enable Serial Port"
- Choose : Port Number: COM1 ( => this will be the Linux serial port /dev/ttyS0)
Port Mode: Host Device
Port/File Path: COM1, if you have a standard serial port and using COM1
or change to adapt to your computer serial port.
If you have the KheperaIII and the Korebot II, you can even use the Bluetooth com port instead
of the KoreConnect. See the Khepera III user manual for the Bluetooth connection.
After starting the virtual machine and having installed the VirtualBox drivers as described in
the next points, the shared folder will be mounted in /mnt/windows/ .
- You may need to add the VirtualBox drivers, depending of the version of your computer
and your VirtualBox. These drivers provide access to network, shared folder, mouse
integration, ...
In the "Device menu" (top bar of the window) of your virtual machine, Install guest
additions.
The Ubuntu OS should be updaded. Use the Update Manager from the menu System,
Administration.
Korebot II development:
You will have the cross-compiler (full toolchain and sources) and development folder
already installed (see the Korebot II user manual) in the virtual machine. You can start
developing as described in chapter "4.4.2.1 Application development".
You should update the toolchain of the virtual machine to the latest available. Follow instructions
in chapter 4.5.2 with the new version from:
http://ftp.k-team.com/KorebotII/software/full_toolchain/
Also the libkorebot should be updated. See instructions at chapters 4.4.1.3 and 4.4.1.5.
- "Power off the machine": WARNING: it doesn't save anything; any work done will be
discarded!
The Java virtual machine is not installed by default on the Korebot II.
5.2.10.1 Instructions for Installing the java virtual machine on the Korebot II
You will find from the link below the packages files to install for having the Java virtual machine
on the KorebotII of your KheperaIII.
http://ftp.k-team.com/KorebotII/software/common/java_vm/
classpath-common_0.96.1-r2_armv5te.ipk
classpath-dev_0.96.1-r2_armv5te.ipk
classpath_0.96.1-r2_armv5te.ipk
jamvm_1.5.0-r0_armv5te.ipk
- Download and transfer them to the robot and install them with the command:
- Install also the Khepera3 interface library file by copying libKhepera3.so file from
http://ftp.k-team.com/KorebotII/software/common/java_vm/Khepera3_java_20120120.zip
into the directory /usr/lib of the Korebot2.
You can test and start developping in Java with the instructions below:
/* Hello.java */
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello world!");
}
}
java Hello
- on the Korebot2, execute this for adding the library path for finding the libKhepera3.so:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib
The machine was build with the commands below. Execute it only if you want to rebuild or patch
the java virtual machine.
Then with the commands below, build the java virtual machine and its library:
classpath-common_0.96.1-r2_armv5te.ipk
classpath-dev_0.96.1-r2_armv5te.ipk
classpath_0.96.1-r2_armv5te.ipk
jamvm_1.5.0-r0_armv5te.ipk
You can rebuild the Khepera3 interface library for adding new functions
or modify parameters.
- add the new declaration of Khepera3.h in libKhepera3.c and transform this function
declaration into the definition by adding code inside.
6. WARRANTY
K-TEAM warrants that the Korebot II is free from defects in materials and
workmanship and in conformity with the respective specifications of the product for the
minimal legal duration, respectively one year from the date of delivery.
If no answers have been received within two working days, Customer can contact K-
TEAM support by phone or by electronic mail with the full reference of its order and
Korebot II serial number.
K-TEAM shall then, at K-TEAM's sole discretion, either repair such Product or
replace it with the equivalent product without charging any technical labor fee and repair
parts cost to Customer, on the condition that Customer brings such Product to K-TEAM
within the period mentioned before. In case of repair or replacement, K-TEAM may own
all the parts removed from the defective Product. K-TEAM may use new and/or
reconditioned parts made by various manufacturers in performing warranty repairs and
replacement of the Product. Even if K-TEAM repairs or replaces the Product, its original
warranty term is not extended.
This limited warranty is invalid if the factory-applied serial number has been altered
or removed from the Product.
This limited warranty covers only the hardware and software components contained
in the Product. It does not cover technical assistance for hardware or software usage and it
does not cover any software products contained in the Product. K-TEAM excludes all
warranties expressed or implied in respect of any additional software provided with Product
and any such software is provided "AS IS" unless expressly provided for in any enclosed
software limited warranty. Please refer to the End User License Agreements included with
the Product for your rights with regard to the licensor or supplier of the software parts of
the Product and the parties' respective obligations with respect to the software.
It is likely that the contents of Customer's flash memory will be lost or reformatted in
the course of the service and K-TEAM will not be responsible for any damage to or loss of
any programs, data or other information stored on any media or any part of the Product
serviced hereunder or damage or loss arising from the Product not being available for use
before, during or after the period of service provided or any indirect or consequential
damages resulting therefore.
Be sure to remove all third parties' hardware, software, features, parts, options,
alterations, and attachments not warranted by K-TEAM prior to Product service. K-TEAM
is not responsible for any loss or damage to these items.
This warranty is limited as set out herein and does not cover, any consumable items
(such as batteries) supplied with the Product; any accessory products which is not contained
in the Product; cosmetic damages; damage or loss to any software programs, data, or
removable storage media; or damage due to (1) acts of God, accident, misuse, abuse,
negligence, commercial use or modifications of the Product; (2) improper operation or
maintenance of the Product; (3) connection to improper voltage supply; or (4) attempted
repair by any party other than a K-TEAM authorized module service facility.
This limited warranty does not apply when the malfunction results from the use of the
Product in conjunction with any accessories, products or ancillary or peripheral equipment,
or where it is determined by K-Team that there is no fault with the Product itself.