If you are very poor developer who cannot afford to buy any cheep ARM evaluation kit, then qemu arm version including Google android emulator is a very good tool to experiment any embedded sw stuffs.

Here some instruction to run a basic C application to print "hello" message on Android emulator are shown.
All information listed here are all taken from the following very useful link and I modified source a little bit to support Android serial console out. 


So I will explain my modifications only which comes from the different serial port configuation used to stdio between versatilepb and android goldfish.

#define GOLDFISH_TTY_PUT_CHAR (*(volatile unsigned int *)0xff002000)

/*
 * This does not append a newline
 */
static void putc(int c)
{
GOLDFISH_TTY_PUT_CHAR = c;

void print_uart0(const char *s) {
 while(*s != '\0') { /* Loop until end of string */
 putc(*s); /* Transmit char */
 s++; /* Next char */
 }
}

Full source code can be downloaded here and compiling it will generate test.bin. It can be compiled with google arm tool chain version 4.2.1 included in Android NDK and include that into current PATH list.
mkdir baremetal
cd baremetal
unzip ../baremetal.zip
./bd.sh

To test this bare metal app, 

export ANDROID_SDK_ROOT={path to android sdk}

emulator @fry -kernel ./test.bin










Posted by kevino
,