ThinkCore W311/321/341 Linux User’s Manual
Getting Started
2-14
If there isn’t enough “Available” space for your application, you will need to delete some existing
files. To do this, connect your PC to the W311/321/341 with the console cable, and then use the
console utility to delete the files from the W311/321/341’s flash memory. To check the amount of
free space available, look at the directories in the read/write directory
/dev/mtdblock3
. Note that
the directories
/home
and
/etc
are both mounted on the directory
/dev/mtdblock3
.
NOTE
If the flash memory is full, you will need to free up some memory space before saving files to
the Flash ROM.
Compiling Hello.c
The package CD contains several example programs. Here we use
Hello.c
as an example to show
you how to compile and run your applications. Type the following commands from your PC to
copy the files used for this example from the CD to your computer’s hard drive:
# cd /tmp/
# mkdir example
# cp –r /mnt/cdrom/example/* /tmp/example
To compile the program, go to the
Hello
subdirectory and issue the following commands:
#cd example/hello
#make
You should receive the following response:
[root@localhost hello]# make
/usr/local/arm-linux/bin/arm-linux-gcc –o hello-release hello.c
/usr/local/arm-linux/bin/arm-linux-strip –s hello-release
/usr/local/arm-linux/bin/arm-linux-gcc –ggdb -o hello-debug hello.c
[root@localhost hello]# _
Next, execute
make
to generate
hello-release
and
hello-debug
, which are described below:
hello-release—
an ARM platform execution file (created specifically to run on the W311/321/341)
hello-debug—
an ARM platform GDB debug server execution file (see Chapter 5 for details about
the GDB debug tool).