imx6q Cross Compile Toolchain Installation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

imx6q Cross Compile Toolchain Installation

Jump to solution
15,010 Views
petersuciu
Contributor III

Hello!


I am using Eclipse on Ubuntu 13.04 x64 and would like to setup a project for cross-compilation for ARM, but I'm quite clueless as how to do it, being a comple te n00b with these 'embedded' things, I find myself staring in disbelief at the screen, unable to get a simple "Hello World" program to compile through and through.


#include <iostream>

using namespace std;

int main()

{

  cout << "Hello World!";

  return 0;

}

I've downloaded Sourcery CodeBench and the GNUARM plugin for Eclipse to use that toolchain, but failed to build a correct elf image, because the linker complains about not finding a __start symbol. If I try to execute the file (Test.elf) on the board, the terminal complains that the file itself cannot be found (!!!) even though I have rwx permissions on it and have chown-ed it. I have also downloaded Linaro and GNUARM toolchains. Building with those outputs a slew of warnings and/or errors that I have not (and SHOULD NOT EVER) seen before. (like: invalid floating point option -mfpu=vfpv3,  or: bad value -march=armv7-a -- not supposed to happen)


My question is, can you guide me in the right direction of setting up a toolchain (environment variables and makefiles is fine, if not with Eclipse), because scouring the Internet has left me wanting for something that is more specific to imx.


Kind Regards,

Peter

0 Kudos
Reply
1 Solution
3,661 Views
LeonardoSandova
Specialist I

There are several toolchains you can use. You can try the one installed by LTIB, or the one compiled (yes, compiled) by Yocto. For the Yocto case, setup a Yocto system (there are many docs regarding this), then on the build folder thy these:

$ bitbake meta-toolchain

$ sh tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ arm-poky-linux-gnueabi-gcc -v

Now you can compile your hello world app.

Leo

View solution in original post

0 Kudos
Reply
4 Replies
3,661 Views
Yuri
NXP Employee
NXP Employee

For stand-alone applications it is needed to provide a start-up code (crt.s), linker file (.ld), minimal syscalls.c

that may be application dependent.

0 Kudos
Reply
3,662 Views
LeonardoSandova
Specialist I

There are several toolchains you can use. You can try the one installed by LTIB, or the one compiled (yes, compiled) by Yocto. For the Yocto case, setup a Yocto system (there are many docs regarding this), then on the build folder thy these:

$ bitbake meta-toolchain

$ sh tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ arm-poky-linux-gnueabi-gcc -v

Now you can compile your hello world app.

Leo

0 Kudos
Reply
3,661 Views
ritesh_panchal
Contributor I

If my application use Source file of other folders than from /opt/poky/1.8/ how to include these files in environment variable?

I am using Eclipse Yocto Autotool Project for application development.

In the project i can use function of any file from "/opt/poky/1.8/sysroots/cortexa9hf-vpf-neon-poky-linux-gnueabi/user/include".

But i want to use files from other directory. so i add paths in "C/C++ General/Path and symbols/include directories".

Now function reference can be found by eclipse. I can also Jump to relavent .h file by F3.

But when i compile i get "fatal error: No file or directory"

0 Kudos
Reply
3,661 Views
petersuciu
Contributor III

Finally! That + Yocto Project Development Manual did it.

0 Kudos
Reply