IMX Hello World: Difference between revisions

From Variscite Wiki
Line 2: Line 2:
= Reference =
= Reference =
[http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html Yocto Project Application Developer's Guide 2.0]
[http://www.yoctoproject.org/docs/2.0/adt-manual/adt-manual.html Yocto Project Application Developer's Guide 2.0]
= Toolchain installation for out of Yocto builds=
Build the toolchain by:
<pre>$ bitbake meta-ide-support
$ bitbake meta-toolchain
</pre>
The output will be located at tmp/deploy/sdk/. On a 64 bit Ubuntu you will get:
sdk/poky-eglibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh
Install the tools by running:
<pre>$ tmp/deploy/sdk/poky-eglibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh</pre>
Reply to all defaults 'y'<br>
The toolchain name depend on your build machine and may change.


= hello World C =
= hello World C =

Revision as of 13:17, 13 December 2015

VAR-SOM-MX6 - Hello World

Reference

Yocto Project Application Developer's Guide 2.0

Toolchain installation for out of Yocto builds

Build the toolchain by:

$ bitbake meta-ide-support
$ bitbake meta-toolchain

The output will be located at tmp/deploy/sdk/. On a 64 bit Ubuntu you will get:

sdk/poky-eglibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh

Install the tools by running:

$ tmp/deploy/sdk/poky-eglibc-x86_64-meta-toolchain-cortexa9hf-vfp-neon-toolchain-1.8.sh

Reply to all defaults 'y'
The toolchain name depend on your build machine and may change.

hello World C

$ mkdir ~/applications
$ cd ~/applications
$ gedit hello.c &

#include <stdio.h> 
 
int main(int argc, char **argv)
{
     printf("Hello World\n");
     return(0);
}

Compile:
$ source /opt/poky/1.8/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi 
$ $CC -o hello hello.c 

Copy:
$ scp hello root@192.168.1.130:~/

On Target:
Fix an issue with the library happen in poky version 1.8
$ ln -s /lib/ld-linux-armhf.so.3 /lib/ld-linux.so.3
Run:
root@var-som-mx6:~# ./hello 
Hello World