CREATING PROJECT
To test the setup you can download example program from following link
CLICK HERE
Suppose it is downloaded in c:\
Unzip this project into LPC2148Test Directory.
So, example program is placed in c:\ LPC2148Test
Now go to File > New > C Project
Give the project name, select make file project and on toolchain select “Other Toolchain”
NOTE: In our PC we have installed sdcc and cygwin, that’s why you are also seeing “Cygwin GCC and SDCC Tool Chain” options. These options will not be available in your PC. So you can ignore them.
Click Next.
Here give your name as author name.
Click Next.
At this step select “Configurations”. Click on Finish.
After creating the project, window will look like as below.
Here you can observe in console pane(present at bottom), it is showing error and warning message, actually it is because we have not added any source files and because eclipse try to build the project automatically.
To disable auto build feature go to Project > Build Automatically
Now we have to add project files in this project.
For that select the project and go to File > Import
After that Import window will appear.
Here we have to select files which we have to import in the system. Here go to General > File System and Click Next.
In this window we have to give the path of directory from where we have to import the files. In our case directory path is C:\LPC2148Test.
And choose all files and click Finish.
BUILD PROJECT
Now we can see our project files are present in the eclipse. By clicking on the main.c file we can see main function in the file.
Let us build the project.
Now go to Project > Build Project.
Below will be the result after building.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
**** Build of configuration Default for project lpc2148 ****
make all
arm-elf-gcc -x assembler-with-cpp -c -mcpu=arm7tdmi -g -gdwarf-2 -Wa,-amhls=src/crt.lst src/crt.s -o src/crt.o
arm-elf-gcc -c -mcpu=arm7tdmi -O0 -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=src/main.lst -MD -MP -MF .dep/main.o.d -I . -I./inc src/main.c -o src/main.o
arm-elf-gcc ./src/crt.o ./src/main.o -mcpu=arm7tdmi -nostartfiles -T./prj/lpc2148_ram.ld -Wl,-Map=test_ram.map,--cref,--no-warn-mismatch -o test_ram.elf
arm-elf-objcopy -O ihex test_ram.elf test_ram.hex
arm-elf-gcc ./src/crt.o ./src/main.o -mcpu=arm7tdmi -nostartfiles -T./prj/lpc2148_rom.ld -Wl,-Map=test_rom.map,--cref,--no-warn-mismatch -o test_rom.elf
arm-elf-objcopy -O ihex test_rom.elf test_rom.hex
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
and in eclipse you can see hex and elf files.
Here you can see that both elf and hex both type of files are created. test_ram.xxx are for downloading in RAM and test_rom.xxx are for downloading in ROM.