Ask Your Question
1

cross compile fuerte for Cortex A8

asked 2013-08-06 11:33:37 -0600

mvalvo gravatar image

updated 2014-01-28 17:17:34 -0600

ngrennan gravatar image

hi, I'm trying to run a ROS application on an embedded device, specifically a Freescale i.MX53 Cortex A8 processor. I figured I'd try something simple like the "talker" and "listener" sample code, and have the "talker" run on the Cortex and "listener" run on Ubuntu. (I've compiled and ran talker and listener on Ubuntu and it works). I've only had a little experience with ROS and zero experience cross-compiling anything.

there is an eclipse-based IDE for developing application for the Cortex that came with the application kit. so there is a folder that the executables for the compilers.

from what I can tell, you need to add a rostoolchain.cmake file to $ROS_ROOT. I've done that and here is the contents:

# An example for using the gumstix arm-linux toolchain is below.
# Copy these lines to $(ROS_ROOT)/rostoolchain.cmake to try them out.
#
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin/arm-cortex_a8-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin/arm-cortex_a8-linux-gnueabi-g++)
set(CMAKE_FIND_ROOT_PATH /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin)
 #Have to set this one to BOTH, to allow CMake to find rospack
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

when I make, I get thousands of errors that make no sense to me.

So, I figure that I should repeat something that has been advertised as working, which is to cross-compile for Gumstix (which also uses a Cortex processor). I did :

  1. sudo apt-get install gcc-arm-linux-gnueabi
  2. sudo apt-get install g++-arm-linux-gnueabi
  3. modified the cmake file:

    # An example for using the gumstix arm-linux toolchain is below.
    # Copy these lines to $(ROS_ROOT)/rostoolchain.cmake to try them out.
    #
    set(CMAKE_SYSTEM_NAME Linux)
    set(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabi-gcc)
    set(CMAKE_CXX_COMPILER /usr/bin/arm-linux-gnueabi-g++)
    set(CMAKE_FIND_ROOT_PATH /usr/bin)
    #Have to set this one to BOTH, to allow CMake to find rospack
    set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
    set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
    set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
    

when I make, I only get 1 error:

/opt/ros/fuerte/lib/libroscpp.so: file not recognized: File format not recognized
collect2: ld returned 1 exit status
make[3]: *** [../bin/talker] Error 1
make[3]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make[2]: *** [CMakeFiles/talker.dir/all] Error 2
make[2]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mvalvo/fuerte_workspace/sandbox/beginner_tutorials/build'
make: *** [all] Error 2

Can you offer any guidance on this?

thanks, Mike

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-06 11:51:07 -0600

ahendrix gravatar image

updated 2013-08-06 13:31:42 -0600

It looks like you're trying to compile on top of the native binary installation that you already have installed.

The basic problem is that you're trying to build ARM binaries that link against the ROS libraries that are compiled for x86. Your environment is "dirty" in the sense that it is trying to link against binaries with the wrong architecture.

You need to do a complete cross-compile of Fuerte from source; you can get started with the Fuerte installation from source instructions, but you'll probably want to use google to look around for advice from other people at well. http://www.ros.org/wiki/fuerte/Installation/Ubuntu/Source

Cross-compiling Fuerte is not something that I would recommend for someone new to ROS, Linux and CMake; I would strong suggest upgrading to a newer version of ROS that has better ARM support instead.

If you're ok using Groovy, you may want to look into the binary builds of Groovy for Ubuntu ARM: http://ros.org/wiki/groovy/Installation/UbuntuARM

edit flag offensive delete link more

Comments

I don't understand your comment. I should probably mention that I am a novice to ROS, linux, and CMake. in the folder ~/fuerte_workspace/sandbox/beginner_tutorials, there is a Makefile. I do "make clean" and then "make". Is that not the regular compile syntax? I have to use Fuerte, so Groovy is not an option. how do I know if I have a "dirty" environment? how do I make it "clean"

mvalvo gravatar imagemvalvo ( 2013-08-06 12:05:10 -0600 )edit

I have the exact same issue on Groovy. The cross-compilation does not (always?) use the target files, but the host files. Also in some cases it doesn't even add the necessary include path (e.g. for boost).

ps4321 gravatar imageps4321 ( 2013-08-12 04:44:41 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-06 11:33:37 -0600

Seen: 599 times

Last updated: Aug 06 '13