Philips Semiconductors
6. Adding user applications
Besides the basic setup, user may run his own application programs to implement
specific functions. Here we use
user application.
The first step should be creating the 'hello' project. The project, as any Linux project, may
include source files, header files and Makefile. The major difference is the compilation
tool in the Makefile should not be normal 'gcc', but the cross compiling tool as 'arm-linux-
gcc', which will generate image files that can run on LPC3180 (ARM9 CPU core).
E.g.
EXEC = hello
OBJS = hello.o
CC = arm-linux-gcc
all: $(EXEC)
$(EXEC): $(OBJS)
clean:
When we get the
(
under Linux Shell.
~ #hello
/******** Hello, World! ********/
/******** Hello, LPC3180! ********/
~ #
7. NAND flash porting
In the Phytec reference board, a ST NAND256R32 32Mbyte NAND flash is mounted.
Users may use different NAND flashes with it. This section gives a guide on how to port
the NAND flash drivers for new type devices.
For frequently used keywords as 'page, block, small/large page, bad block' and more
related information on NAND flash, the technical paper can be found on the website:
http://www.linux-mtd.infradead.org/doc/general.html
7.1 Content list
In the Linux staged boot process, SIBL, U-boot and Linux kernel are all involved in NAND
flash function implementation.
The relevant files supporting NAND Flash function in SIBL are:
sibl/sibl_flashboot_phytec.c
sibl/sibl_flashboot_phytec.h
In U-Boot:
uboot/common/cmd_nand.c
uboot/lib_nand/lpc3180_nand_abi_phyte
uboot/lib_nand/lpc3180_nand_phytec.c
uboot/lib_nand/nand_base.c
uboot/lib_nand/nand_ecc.c
uboot/lib_nand/nand_bbt.c
uboot/lib_nand/nand_ids.c
<12NC>
Application note
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
-rm -f $(EXEC) *.elf *.gdb *.o
'hello'
root_fs_arm.ext2.phytec.gz
Rev.03 — 21 Dec 2006
program as an example to explain how to add
'hello'
executable file, copy it to the ./bin directory of rootfs
), then the program can be used as a command directly
c.c
AN10476
Getting started Linux with LPC3180
© Koninklijke Philips Electronics N.V. 2004. All rights reserved.
20 of 28