As a tradition, we will start with a simple Hello World program. This will allow us to verify the following:

  • NFS - which should already be verified

  • SSH between host and target

  • More importantly the cross tool chain. We need to build an executable that is compatible with the dragonboard.

  • Execute on the board.

Eclipse project:

  • Create a new makefile project as shown in the screenshot below.

    • Note the location of the project - this is the folder that is exported to dragonboard.

Makefile project in Eclipse

  • Add a new source file (.c) and a Makefile (just add new file) with contents shown below.

    • Some information on the Make 

Source code:

#include <stdio.h>
#include <stdlib.h>

int main(void)
{

	printf("Hello World!, this is Dragonboard.\n");
	return 0;
}

Makefile for Hello World:

#
#  Makefile for ARM/Linux user application
#  make all - build dragonboard_test
#  make dragonboard_test - build dragonboard_test
#  make clean - clean

CC = aarch64-linux-gnu-gcc

all: dragonboard_test

dragonboard_test: dragonboard_test.c
	${CC} -o $@ $<

clean:
	rm -f *.o
	rm -f dragonboard_test

  • Build using Make (Shift + F9).

If all goes well, you should have executable in the project folder.

Execute on target:

  • You should see the executable on the NFS mounted location on the dragonboard.

  • Execute the application.

        ./dragonboard_test
  • You should see hello message on the console. See screenshot below (I am using PuTTY for SSH).

Program output on target

Congratulations! On your first program on dragonboard.

 

Some handy shortcuts for Eclipse:

Shortcut

Action

F5

Step in

F6

Next step

F7

Step out

F8

Run until next breakpoint

F11

Debug

Ctrl + F11

Run

Ctrl + F8

Switch perspectives

Ctrl + B

Build

Shift + F9

Make target build

F9

Rebuild last target

 

Add comment


Security code
Refresh