Search by Tags

Embedded Linux Sample Code

 

Compare with Revision




Subscribe for this article updates

Some Embedded Linux sample code can be found in the Samples folder of our file download server:

Samples

For a cross toolchain see Build U-Boot and Linux Kernel from Source Code.

GTK+ Example

A make file project which compiles the scribble-simple.c from http://developer.gnome.org/gtk-tutorial.

Download gtk_scribble_V2.zip from our Samples page.

Makefile.ExtToolchain_Rootfs is a makefile suitable for use with an external cross toolchain and the rootfs contained in our image.
Set OECORE_TARGET_SYSROOT and CROSS_COMPILE to your needs.

Makefile.OE_Sysroot is a makefile suitable if you have built openembedded yourself. It uses the OpenEmbedded built cross toolchain, headers and target libraries.
Set OECORE_NATIVE_SYSROOT, OECORE_TARGET_SYSROOT and CROSS_COMPILE to your needs.

Make a symlink 'Makefile' pointed to the flavour you want to use. e.g.

ln -s Makefile.ExtToolchain_Rootfs Makefile

To use it from within eclipse:

In the Project Explorer:
- right click and chose import
- General/Existing Projects into Workspace
- Browse for the archive file gtk_scribble.zip
- Finish

In the Make Targets View you get make targets to compile for ARM and for x86.
'all' for x86 Linux,
'all.arm' for the Colibri T20.

To use it from the command line:

unzip the archive
for x86 Linux:

make CROSS_COMPILE=  all

for Colibri T20:

make all

OpenGL ES Samples

NVIDIA OpenGL ES 2.0 Samples

The sample programs from NVIDIA are available for download from our Samples page. These samples are only meant for the Tegra 2 and Tegra 3 Modules.

OpenEmbedded build

You can cross-compile and add the samples to a Linux image using OpenEmbedded.

How to build using OpenEmbedded

Cross-compile from source

It might be useful to build from source when developing an application.

How to cross-compile from source

ARM's OpenGL ES 2.0 emulator and sampĺes

ARM provides an OpenGL ES emulator that maps OpenGL ES API calls to the OpenGL API, and it can be found here. It comes without samples, but you can also download the ARM Mali SDK for Linux, that is shipped with samples and can be built to run by the emulator but also on top of devices that support OpenGL ES and X11.

Cross-compile from source

It might be useful to build from source when developing an application.

How to cross-compile the samples

NXP/Freescale's i.MX6 Graphics SDK

NXP/Freescale provides GPU SDKs shipped with OpenGL ES and OpenVG samples. You can build the samples from it for use on top of X11.

There are two versions of the GPU SDK, and both of them are available here, being:

  • The old SDK under the "Snippets, Boot Code, Headers, Monitors, etc." section and;
  • The new SDK under the "Software Development Kits" section once clicking "More".

At the time of writing, The old SDK revision is 1.0.0 (dated 01/25/2013) and the new SDK revision is 2.3 (dated 02/23/2016).

Cross-compile using the old SDK

The old SDK has OpenGL ES 1.1 and 2.0, and OpenVG samples. It is a Makefile based project with X11 and framebuffer support. Below are provided instructions on how to build the samples for X11.

How to cross-compile using the old SDK

Cross-compile using the new SDK

The new SDK has OpenGL ES 2.0 and 3.0, and OpenVG samples. It has its Makefiles generated by Python scripts and supports Android SDK+NDK, Ubuntu, Windows and Yocto builds, being the latter possible for X11, framebuffer and Wayland. Below are provided instructions on how to build the samples for X11, using OpenEmbedded/Yocto.

How to cross-compile using the new SDK