Showing posts with label embedded. Show all posts
Showing posts with label embedded. Show all posts

27/07/2011

Running a C HelloWorld on ARM BeagleBoard

In this simple tutorial I will show you howto prepare your linux distribution for compiling and running C code on a BeagleBoard (ARM architecture). In short, you will need to install the cross-compiler, connect the board with your computer, load the compiled binaries to the board and finally execute them. Here we go in more details:

0. Prerequisites
  • Linux OS distribution (Ubuntu or Fedora should do)
  • BeagleBoard-xm with ARM A7 processor (or higher)


1. Install the ARM compiler

Image
You will need to install a compiler for ARMv7 / Linux. See for example ARM/GNU Linux.

Let's assume you have installed the compiler into the following location: /opt/CodeSourcery/Sourcery_G++_Lite.

Then add the location into your PATH:
$ export  PATH=$PATH:/opt/CodeSourcery/Sourcery_g++_Lite/bin

And test your compile by executing:
$ arm-none-linux-gnueabi-gcc  -o hello.arm hello.c

This should work, later on we will use the generated hello.arm to run it on the beagle-board.

2. Connecting the BeagleBoard

Here is a nice manual on setting up the BeagleBoard on a linux-server machine:
http://elinux.org/BeagleBoardBeginners

After going through the manul, your board should be sitting on your network at some IP address, it may be for example 192.168.0.2

To connect to the board:

Tip: If you reboot your linux desktop, you probably want to do the following to re-enable the connection with the board:
$ sudo ifconfig usb0 192.168.0.3

3. Running HelloWorld on BeagleBoard

First, we need to copy the executable to the BeagleBoard:
$ scp hello.arm [email protected]

And then just login to the board and run the executable:
$ shh [email protected]
$ ./hello.arm 
Hello World!

And that should be all.

[Note: This tutorial is based on my notes when working with the beagle-board, so it may omit some details. Hope it will help anyway.]

16/11/2009

A New Real-time VM Was Born - Fiji VM

The new virtual machine for real-time world is here. Fiji VM technology enables developers to:
  • Seamlessly integrate pure Java code into real-time, safety-critical, and mission-critical systems.
  • Deploy on a broad range of hardware and operating systems, ranging from ARM and ERC32 to PowerPC and x86/x86_64, from RTEMS to Linux or Darwin.
  • Boot Java from bare hardware - for small footprint (100KB) applications, Fiji VM provides the unique ability to boot Java from bare hardware.
  • Execute Java with deterministic garbage collection, as well as full support for safe GC-less allocation.
  • Achieve high performance execution. From the peformance perspective, Fiji VM seems very promising, having only 40% slow down comparing to C.
Fiji VM library choicesFiji VM technology offers a variety of footprint and library options to the developer, if extremely small footprint (100KB) is desired, Fiji offers Fiji HardRTJ library.

To give you a better picture, here is how FijiVM fits into the whole stuck:

fiji diagram
Fiji VM 1.0 release is coming in December 2009. More at Fiji Systems LLC home page.