EmbeddedRelated.com
Forums

eclipse and LPC2148

Started by Bruce November 1, 2009
--- In l..., Bruce Lindsay wrote:
>
> Since this is related I'll keep it in the same topic.
>
> I am getting a couple of errors in the Logomatic project. I am using
> Richards make file to build with. The errors are:
>
> make: *** [all] Error 2
>
> make[1]: *** No rule to make target `lpc2148-FLASH.ld', needed by
> `Logomatic.elf'.
>
> Here is my make file.

Make can't find lpc2148-FLASH.ld in the project directory or the current directory when make is executing.

When you do 'make', 'all' is the default target and 'all' depends on ${LDSCRIPT} which is a macro for the name of the linker script lpc2148-FLASH.ld

But the real problem is that you shouldn't be using that makefile at all. It only builds main.c and Logomatic is a lot more than that.

In message 45846 I pointed out how to import and build Logomatic in Eclipse. I posted a ZIP file with the entire project. I hope you downloaded it at the time. I have since deleted it. I don't leave stuff in the Files folder very long. Two, maybe three days tops.

Basically, when you import Logomatic, at the top level all you have are 3 directories: lib, LPCUSB and main. You have no code and no makefile at the top level. In the 'main' subdirectory there is a makefile that will build the entire project including all the code in the other directories. This project structure probably doesn't work all that well for Eclipse.

So, what I did was create a Makefile at the top level that did nothing except change into the main subdirectory and recursively call 'make'.

I won't have access to my Linux box for several days so I can't retrieve the file and I doubt very much that the I can recreate the shell code off the top of my head. So, I might try instead:

--------------------
.PHONY all

all:
cd main
make -C
--------------------

The target 'all' doesn't have any dependencies and all it does is change directories and call make.

This results in a top level Makefile to satisfy Eclipse and it keeps the Logomatic directory structure intact.

It is very likely that you will need to change the Makefile within the 'main' subdirectory to use your toolchain. That change was not required on my system. Be very sparing in your changes.

The whole reason I imported the code as it was presented was that I didn't want to make ANY changes to the Logomatic files. The Makefile, as I recall, was far above my pay grade.

Richard

An Engineer's Guide to the LPC2100 Series

--- In l..., "rtstofer" wrote:

> In message 45846 I pointed out how to import and build Logomatic in Eclipse. I posted a ZIP file with the entire project. I hope you downloaded it at the time. I have since deleted it. I don't leave stuff in the Files folder very long. Two, maybe three days tops.
>
> Basically, when you import Logomatic, at the top level all you have are 3 directories: lib, LPCUSB and main. You have no code and no makefile at the top level. In the 'main' subdirectory there is a makefile that will build the entire project including all the code in the other directories. This project structure probably doesn't work all that well for Eclipse.

Well, duh, I forgot that I moved a copy of the workspace directory to this computer. It's a Win7 box so I can't build the projects but I do have a backup copy.

So, I have posted Logomatic to the Files folder. Get it while it's hot!

I also had to export a PATH for the Makefile in the 'Main' subdirectory to use. But I was using the same toolchain so I didn't make any changes to the distribution.

Again, import this to Eclipse such that the 3 subdirs and the Makefile are all that shows up at the top level of the project.

You can find the compiler program names about half way down the Makefile:

CC = arm-elf-gcc
CPP = arm-elf-g++
OBJCOPY = arm-elf-objcopy
OBJDUMP = arm-elf-objdump
SIZE = arm-elf-size
NM = arm-elf-nm

Richard
--- In l..., "rtstofer" wrote:
> You can find the compiler program names about half way down the Makefile:
>
> CC = arm-elf-gcc
> CPP = arm-elf-g++
> OBJCOPY = arm-elf-objcopy
> OBJDUMP = arm-elf-objdump
> SIZE = arm-elf-size
> NM = arm-elf-nm
>
> Richard
>

That would be the distribution Makefile in the Main subdirectory.

Richard
Okay, I put your makefile in my top directory and I still get errors. I
have a question about the following line in the Logomatic Makefile:

CDEFS += -D__WinARM__
ADEFS += -D__WinARM__

I'm using the Code Scourcery tool chain in Linux. Do you know what they
do or should be changed to?

I may have to break down and download WinARM onto my Windows PC.
--- In l..., Bruce Lindsay wrote:
>
> Okay, I put your makefile in my top directory and I still get errors. I
> have a question about the following line in the Logomatic Makefile:
>
> CDEFS += -D__WinARM__
> ADEFS += -D__WinARM__
>
> I'm using the Code Scourcery tool chain in Linux. Do you know what they
> do or should be changed to?
>
> I may have to break down and download WinARM onto my Windows PC.
>

I would comment them out unless you change to WinARM

What errors are you getting?

Logomatic
...Includes
......<I think this subdir is empty>
...lib
......<whatever files are in the lib subdirectory
...LPCUSB
......<whatever files are in the LPCUSB subdirectory
...Main
......<whatever files are in the Main subdirectory plus>
......Makefile <the distribution Makefile>
...Makefile <the top level Makefile>

Since you are questioning the Makefile macros, I am assuming the top level Makefile does change to the Main subdirectory and invoke 'make -C' Right?

What errors are you getting?

I build the code using the GNU toolchain under Linux. I have never tried to build it using WinARM. As that computer is still functional, I'll see what I can find out.

I don't know what CodeSorcery has done to the GNU toolchain other than add an IDE but I would be willing to bet that the code won't compile without substantial changes.

If I get this thing to compile under YAGART (Eclipse/WinARM), I'll let you know.

Richard
--- In l..., "rtstofer" wrote:
>
> If I get this thing to compile under YAGART (Eclipse/WinARM), I'll let you know.
>
> Richard
>

On my x86 box with YAGARTO, I couldn't get anything to work correctly. I have been having a problem with YAGARTO since I upgraded a few months ago. I haven't tried to fix it because I don't use it. But that machine doesn't have networking because...

My work room is completely dismantled because we are getting new windows tomorrow. The kind with glass... So, I can't reload YAGARTO and the box doesn't have WinARM

So, I downloaded WinARM to this machine (Win7 x64) and one of the sample programs compiled and linked just fine. But when I tried to build Logomatic, everything compiled just fine but the linker is bitching about the libraries being build for hardware floating point and the project being built for software floating point.

This floating point thing has been a nightmare for years.

When I build the GNU toolchain under Linux, I build it for software floating point. But that's the nice thing about doing this stuff under Linux. I can control every aspect of the project.

So, WinARM may not work. YAGARTO on my x86 box doesn't work. WinARM on my x64 box works but not for this project.

I won't have my Linux box back until Thursday at the earliest and then we aren't using the same toolchain.

I guess I just can't help you with this project. Good luck!

Richard