EmbeddedRelated.com
Forums

eclipse and LPC2148

Started by Bruce November 1, 2009
I am attempting to set up eclipse for the first project. I have a Ubuntu Linux computer and eclipse Galileo. I have downloaded the code for the Sparkfun Logomatic board.

I set up the project settings according to carrierwave tutorial. Although I am concerned about the name of the command for the assembler, compiler, etc. I set the commands to: assembler=arm-none-eabi-as, compiler=arm-none-eabi-gcc, linker=arm-none-eabi-ld, create flash image=arm-none-eabi-objcopy, print size=arm-none-eabi-size, create listing=arm-none-eabi-objdump.

When I clean the project I get the error:
Description Resource Path Location Type
make: *** No rule to make target `main.elf', needed by `all'. LPC2148 Project Template line 0 C/C++ Problem

Anyone have a clue about what I should do to get this project setup correctly?

An Engineer's Guide to the LPC2100 Series

This is a makefile problem, it has nothing to do with the eclipse or linux,
acctually both are working ok, the project is being made with the
arm-elf-gcc tools,

Seek for the main.c line of the make file, if it is poiting to the propper
place, probably there are paths you will need to change on the makefile.
I use Eclipse and GNUARM with Linux all the time. However, for a first cut, I just tried a command line 'make'. And it works!

I am wondering if you have GNUARM installed. Your compiler name should be arm-elf-gcc.

If you don't have GNUARM installed, go to www.gnuarm.org/support.html. You MUST enter the site at this point, otherwise you will be redirected to YAGARTO.de.

Move to the Files tab and download the GCC-4.3 toolchain (4 files). Follow the instructions on the support page EXCEPT, add

--disable-werror

to the configuration lines. I do it for all of them but binutils absolutely requires it and I believe insight/gdb does as well.

You have a couple of choices re: building the toolchain. First, put everything in a subdirectory of your home directory. Like ./armtools

Unpack the files and step down into each of the new subdirectories. Create a new subdirectory ./build and cd into that. That's what the instructions mean when they say cd [binutils-build]. The two choices are what to do with --prefix
You can use --prefix=/usr/local/ and then just do 'make all'. After the files are built, do 'sudo make install' and everything will wind up in /usr/local/bin where the /bin part is 'magic'.

The alternative is to use --prefix=/home/<your user name>/armtools and then just do 'make all install'. Everything will wind up in a bin subdirectory of ~/armtools. Then you can just EXPORT the path before you try to build the project.

I tend to put the build in a local directory and add the path to my makefiles. Like this:



and this (if I am using the libraries, which I am not in this particular makefile):



The LIBRARIES macro is used when I finally link the project:



For your project all I did was export the path like:

export PATH=/home/rstofer/armtools/bin:$PATH

and then just did a 'make' from the 'Main' subdirectory of the source tree.

Step 2 would be to get this in an Eclipse project. I'll leave that as an exercise for the reader. Hint: create a blank Makefile project with the Other toolchain option and then import the subdirectories from where you unpacked them. Import the 3 subdirectories and DO NOT build the entire directory structure (a selection where you tell Eclipse to only make specific directories). You'll see the radio button.

You project now has Includes, lib, LPCUSB and Main folders. You need to make a top level Makefile that will cd into 'Main' and run 'make all'. In my case I also have to mess with the PATH because the project Makefile has no idea where my toolchain is and I didn't want to modify it.

The top level Makefile looks like:



My personal incantation of GNUARM doesn't support interworking so I have a few LD warnings but the firmware compiles just fine. It links so I'm not sure the warnings really matter.

Good Luck!

Richard
I uploaded Logomatic.zip to the Files folder. Unzip it into a temp directory and change the unforunate choice of project names to Logomatic instead of Logomatic1 (there was a reason...)

File->New->C Project -> Makefile Project -? Other toolchain and Project Name = Logomatic

Select the project then right click -> Import File System and browse until you have only the Logomatic directory in the bottom panel.

Select the directory and then select the 3 subdirectories on the following dialog. Select Logomatic one more time and select the Makefile in the right panel.You should have 3 directories and 1 file selected. Finish

You should wind up with a project with the 4 subdirectories I mentioned earlier Includes plus the 3 you selected.

Click on the Build All button and you should see the entire package being built.

Richard
Alright, here is my Makefile. This generated by eclipse. The one that was in the main folder I took out thinking it was interfering with eclipse.

--- In l..., "Bruce" wrote:
>
> Alright, here is my Makefile. This generated by eclipse. The one that was in the main folder I took out thinking it was interfering with eclipse.
>

I have never used Eclipse to create a Makefile. That type of Makefile is well above my pay grade.

The reason I didn't change the project structure or the project Makefile is that it is far too complex (for me). It was just easier to live with it by creating a top level Makefile that cd'd into the Main subdirectory and invoked make with the project Makefile.

Apparently Eclipse wants the primary makefile at the top of the project. Makes sense...

Richard
> The reason I didn't change the project structure or the project Makefile is that it is far too complex (for me). It was just easier to live with it by creating a top level Makefile that cd'd into the Main subdirectory and invoked make with the project Makefile.
>
> Apparently Eclipse wants the primary makefile at the top of the project. Makes sense...
>
> Richard
>

I think I here what you are saying. The makefile needs to be in the top project folder, or does it need to be in the main.c folder?

I guess I could try it with the makefile that is provided with the Logomatic code.
--- In l..., "Bruce" wrote:
> I think I here what you are saying. The makefile needs to be in the top project folder, or does it need to be in the main.c folder?
>
> I guess I could try it with the makefile that is provided with the Logomatic code.
>

I left the project structure and the Makefile in the Main subdirectory exactly the way they came. I changed nothing.

But after the project is created with the 3 subdirectories, there is nothing at the main project level. That's where I added my own simple Makefile so that Eclipse could find it.

The zip file I posted has exactly this structure.

In any event, builds and I wind up with the .hex file in the Main folder.

As an expansion, I would add a 'program' target in the top level Makefile. That target would depend on ./Main/<whatever the name is>.hex. (I'm not near the computer I used to build the project).

The program target would send the .hex file to the chip using whatever method is used with the board. I didn't go that far.

Then I use the External Tools feature to initiate a 'make program' with the directory pointing to the project. Remember you need to change the project directory every time you work on another project. It's odd to be working on a project and continuing to flash a completely different image!

Richard
this makefile is way too complicated 4 me, I an't help. maybe you should try
to use the Richard exemple.
Well I'm at my wits end with this mess. It's damn near worth paying $12,000 for a professional development package. The $12,000 probably goes to the family of the guy that killed himself after figuring out how to do this.

If someone has an eclipse project that actually works for the lpc2148 I would appreciate it if you could archive the entire directory and email it to me. I'm of course assuming that the configuratiopn for the project would be in the project directory.