Mobots' robots
Toolchain
français | english
Navigation
Home
Sitemap
This wiki
This page

Installation

You can download the toolchain here:

for x86_64 (64bit Linux): mobots.epfl.ch/mx31moboard/sdk/angstrom-2010.4-test-20100608-x86_64-linux-armv6-linux-gnueabi-toolchain-mobots.tar.bz2

for i686 (32bit Linux): mobots.epfl.ch/mx31moboard/sdk/angstrom-2010.4-test-20100622-i686-linux-armv6-linux-gnueabi-toolchain-mobots.tar.bz2

You then simply need to untar the corresponding archive on your computer. We recommend you to untar it at / so that it gets installed in /usr/local/angstrom

Usage

The general suffix to the compiler is arm-angstrom-linux-gnueabi- . So if you need to call gcc, its name is going to be arm-angstrom-linux-gneabi-gcc.

Assuming that you have untared the toolchain in /, to use the compiler, you must do:

source /usr/local/angstrom/arm/environment-setup

If you use CMake, you can configure cross-compiling using moboard.cmake:

cmake -DCMAKE_TOOLCHAIN_FILE=~/moboard.cmake .

Assuming that moboard.cmake is located in your home directory. Here is a link to the moboard.cmake file: mobots.epfl.ch/mx31moboard/sdk/moboard.cmake

Debugging

The toolchain includes gdb (called arm-angstrom-linux-gnueabi-gdb) and it can be used to debug programs running on the robot from your computer.

To achieve this, we use remote cross-target debugging with gdbserver.

First you need to compile your program with the debug option (-g with gcc) so that it contains the debug symbols.

With cmake, you need to add the -DCMAKE_BUILD_TYPE=Debug option, so if we go back to the above command it becomes this:

cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=~/moboard.cmake .

On the robot, run your progam with gdbserver and the port the server is going to listen to for the TCP connection:

# gdbserver :5000 yourprogram

On your computer, just start your program with the toolchain's debugger:

# arm-angstrom-linux-gnueabi-gdb

(If gdb complains about not being able to load libexpat.so.0, just create a /usr/lib/libexpat.so.0 to /usr/lib/libexpat.so)

You need to tell gdb where the libs are on your computer (here is the default sdk install path):

(gdb) set solib-search-path /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi

Then tell gdb to read the symbols from your debug enabled program:

(gdb) symbol-file yourpgram

Then you just need to issue the target command in gdb on your computer so that it connects to the gdbserver on the robot:

(gdb) target remote robot_ip_address:5000

From this point, you can use gdb as if you were debugging on your computer. Please note that not all libraries have the debug symbols enabled.

Troubleshooting

If you do not use cmake, note that to have -ffast-math issuing correct FPU instructions, you must use these flags in gcc:

-mfpu=vfp -mfloat-abi=softfp

Search
Share