Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | LPC2000 | eclipse and LPC2148

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

eclipse and LPC2148 - Bruce - Nov 1 15:38:05 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?

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: eclipse and LPC2148 - "Felipe de Andrade Neves L." - Nov 1 17:57:54 2009

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.

2009/11/1 Bruce

> 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?
>
>
>
[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 1 18:01:30 2009



--- In l...@yahoogroups.com, "Bruce" wrote:
>
> 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?
>

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//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:

LOCATION = /home/rstofer/armtools
CC = ${LOCATION}/bin/arm-elf-gcc
LD = ${LOCATION}/bin/arm-elf-ld
AR = ${LOCATION}/bin/arm-elf-ar
AS = ${LOCATION}/bin/arm-elf-as
CP = ${LOCATION}/bin/arm-elf-objcopy
OD = ${LOCATION}/bin/arm-elf-objdump
SZ = ${LOCATION}/bin/arm-elf-size

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

#ARCHIVE1 = ${LOCATION}/lib/gcc/arm-elf/4.3.2
#ARCHIVE2 = ${LOCATION}/arm-elf/lib
#LIBRARIES = -L${ARCHIVE2} -lc -lg -L$(ARCHIVE1) -lgcc

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

${TARGET}.elf : ${LDSCRIPT} crt.o ${OBJS} Makefile
${LD} ${LDFLAGS} -o ${TARGET}.elf crt.o ${OBJS} ${LIBRARIES}

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:

SUBDIRS=Main

PATH=/home/rstofer/armtools/bin:/usr/bin:/usr/local/bin:/bin

.PHONY: all clean

all:
@for i in ${SUBDIRS}; do \
(cd $$i; make all); done

clean :
@for i in ${SUBDIRS}; do \
(cd $$i; make clean); done

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

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 1 18:32:09 2009

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

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce - Nov 1 19:34:26 2009



--- In l...@yahoogroups.com, "rtstofer" wrote:
>
> 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.

################################################################################
# Automatically-generated file. Do not edit!
################################################################################

-include ../makefile.init

RM := rm -rf

# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include lib/subdir.mk
-include Main/subdir.mk
-include LPCUSB/subdir.mk
-include objects.mk

ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
ifneq ($(strip $(ASM_DEPS)),)
-include $(ASM_DEPS)
endif
ifneq ($(strip $(S_UPPER_DEPS)),)
-include $(S_UPPER_DEPS)
endif
endif

-include ../makefile.defs

# Add inputs and outputs from these tool invocations to the build variables
EXECUTABLES += \
USER_OBJS \

SECONDARY_FLASH += \
main.hex \

SECONDARY_SIZE += \
main.siz \

SECONDARY_LIST += \
main.lst \
# All Target
all: main.elf

# Tool invocations
@echo 'No tool found that can build the extension specified with the build artifact name $@'
USER_OBJS: $(OBJS) $(USER_OBJS)
@echo 'Invoking: ARM Sourcery Linux GCC C Linker'
arm-none-eabi-ld -T"/home/bruce/ARMworkspace /LPC2148 Project Template/Main/main_memory_block.ld" -nodefaultlibs -Xlinker -gc-sections -Wl,-Map,main.map -mcpu=arm7tdmi-s -g -o"USER_OBJS" ../Startup.o $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building: $@'
@echo ' '

main.hex: main.elf
@echo 'Invoking: ARM Sourcery Linux GNU Create Flash Image'
arm-none-eabi-objcopy -O binary main.elf "main.hex"
@echo 'Finished building: $@'
@echo ' '

main.siz: main.elf
@echo 'Invoking: ARM Sourcery GNU Print Size'
arm-none-eabi-size --format=berkeley main.elf
@echo 'Finished building: $@'
@echo ' '

main.lst: main.elf
@echo 'Invoking: ARM Sourcery GNU Create Listing'
arm-none-eabi-objdump -h -S main.elf >"main.lst"
@echo 'Finished building: $@'
@echo ' '

# Other Targets
clean:
-$(RM) $(SECONDARY_SIZE)$(OBJS)$(C_DEPS)$(ASM_DEPS)$(SECONDARY_FLASH)$(EXECUTABLES)$(SECONDARY_LIST)$(S_UPPER_DEPS) main.elf
-@echo ' '

.PHONY: all clean dependents
.SECONDARY:

-include ../makefile.targets

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 1 21:13:38 2009



--- In l...@yahoogroups.com, "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

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce - Nov 1 21:54:40 2009



--- In l...@yahoogroups.com, "rtstofer" wrote:
>
> --- In l...@yahoogroups.com, "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
>

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.

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 1 22:14:35 2009



--- In l...@yahoogroups.com, "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/.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

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: eclipse and LPC2148 - "Felipe de Andrade Neves L." - Nov 2 1:27:03 2009

this makefile is way too complicated 4 me, I an't help. maybe you should try
to use the Richard exemple.

2009/11/2 rtstofer

> --- In l...@yahoogroups.com , "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/.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
>
>
>
[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce - Nov 5 21:39:02 2009

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.

--- In l...@yahoogroups.com, "Bruce" wrote:
>
> 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?
>

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - stevec - Nov 5 22:47:28 2009


As a hobby endeavor, I can see not spending $$$$.

As I recall, I purchased an IAR key-fob based license for $4200 or so, plus cost of a J-link JTAG. I've been very pleased with this for my professional work.
--- In l...@yahoogroups.com, "Bruce" wrote:
>
> 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.
>
> --- In l...@yahoogroups.com, "Bruce" wrote:
> >
> > 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?
>

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - cfbsoftware1 - Nov 5 23:37:33 2009

--- In l...@yahoogroups.com, "Bruce" wrote:
>
> 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.
>

Any of the three on their own i.e. Eclipse / gcc / Linux are difficult enough to set up so you should not be at all surprised that you are struggling with a combination of all three. I would be reluctant to tackle that even with my 35 years of professional software development experience behind me. (Including 10 years of C and Unix, and a couple of years with gcc). Maybe you have to know what you can't do to avoid even trying it?

It doesn't really need to be that difficult and it doesn't need to be anywhere near that expensive either.

Unfortunately we can't help you directly right now as we don't currently explicitly support the Logomatic boards with Armaide. However, you don't appear to be alone in your struggles so we are hoping to add it to the list in the not too distant future,

--
Chris Burrows
CFB Software
Armaide: LPC2xxx Oberon-07 Development System
http://www.armaide.com

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 5 23:38:13 2009



--- In l...@yahoogroups.com, "Bruce" wrote:
>
> 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.

You might be surprised at the results. Most of the fancy integrated environments 'help' you be encapsulating configuration information in dialog boxes and such. You can spend days trying to figure how to build the most simple project.

I prefer a simple Makefile. Everything I need to know about my program is right in front of me. The startup code, the C code, the linker script and the Makefile. Nothing is hidden.

But that's just my preference. Frankly, I think it is just because I am old and don't do well with change.
>
> 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.

I don't think trying to copy an Eclipse project will be beneficial because I fear the project files have embedded full path names. I don't know that but I believe it to be true.

I just posted ARM2148Timer.zip to the Files folder. It is a complete set of files for a timer that I didn't write. The code itself is not important.

Unip the file to a temporary directory. Do NOT unzip it inside your workspace directory. Files have to be imported into the workspace. Copying won't work. Although you can copy between projects while using Eclipse to do the work.
In Eclipse: File -> New -> C Project
Enter a Project name
Highlight Makefile project
Ensure that -- Other Toolchain -- is highlighted
Click Finish

.. you now have an empty project

Right click on the project in the Navigator panel - on the left of my screen.

Select Import (from the flyout menu) -> File System -> Next and browse to find your temporary directory - you won't select any files just yet. Click OK after you have found the directory.

A dialog will pop up with the directory in the left panel and a list of files in the right panel.
In this case, click the Select All button and click Finish.

Now if you expand the project in the Navigator panel, you will see all of the files plus an Includes directory that Eclipse creates. I don't know why...

Double click on the Makefile and look at the way I specified the LOCATION of the arm toolchain and look a little farther down where I specified the GCC version in ARCHIVE2. Fix these for your system.

Sometimes the path is /usr/local because the files are in /usr/local/bin But I don't have my machine set up that way.

Select Project -> Properties -> C/C++ Build
On the Builder Settings tab, check Use default build command. The Build command should be 'make' and the Builder type should be External builder. Down in the Build directory box there should be a path to your project.
Click OK

Click the Build All icon (piece of paper with 010) or Ctrl-B. The project should get built.

This same process will work with the Logomatic code I posted a few days ago. I have since deleted it. If you need it, just ask. I can repost it.

A slight hint: once you unzip the files, you can drop to a command line and edit the Makefile as described above. Then you can run 'make' from the command line and the project should get built.

This should also work after you import the files into the workspace. All Eclipse does for these Makefile projects is invoke make with a suitable command line. If it builds from the command line, you know you are on the right track.

If, after all this, you still can't get it working, drop me an email. I am using the Ganymede version of Eclipse and there might be some differences with what you are using.

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - mhoneywill - Nov 6 3:43:53 2009



--- In l...@yahoogroups.com, "Bruce" wrote:
>
> Well I'm at my wits end with this mess. It's damn near worth paying $12,000 for a professional development package.

You've probably looked at this, but why not try Crossworks for Linux
http://www.rowley.co.uk/arm/index.htm $150 for hobby use. Free to evaluate. It also uses the GCC compiler. This might just get you started and give you some confidence in GCC / Linux / LPC2148

You can then carry on with Crossworks (Tech support is very good) or step over to Eclipse.

Good luck

Martin

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce - Nov 7 10:26:42 2009

Ok, I downloaded the Timer project and edited the make file for the paths. I use linux so I also use Code Sourcery's arm-none-eabi. When I did a build all I still got the error:

Description Resource Path Location Type
make: *** No rule to make target `all'. ARM2148Timer line 0 C/C++ Problem

I am guessing that I have a path problem so I will post my make file here:

-----------------------here is the make file ------------------------

# $Id: Makefile,v 1.0 2006/04/06 06:55:34 RTS Exp $

DATE = `date "+%c"`
NAME = LPC2148_Timer
TARGET = Timer
LDSCRIPT = lpc2148-FLASH.ld

LOCATION = /home/bruce/CodeSourcery/Sourcery_G++_Lite/

CC = ${LOCATION}/bin/arm-none-eabi-gcc
LD = ${LOCATION}/bin/arm-none-eabi-ld
AR = ${LOCATION}/bin/arm-none-eabi-ar
AS = ${LOCATION}/bin/arm-none-eabi-as
CP = ${LOCATION}/bin/arm-none-eabi-objcopy
OD = ${LOCATION}/bin/arm-none-eabi-objdump
SZ = ${LOCATION}/bin/arm-none-eabi-size

ARCHIVE1 = ${LOCATION}/arm-none-eabi/lib
ARCHIVE2 = ${LOCATION}/lib/gcc/arm-none-eabi/4.3.3
LIBRARIES = -L${ARCHIVE1} -lc -lg -L$(ARCHIVE2) -lgcc
# in -adnhls the 'd' turns off debugging info and the 'n' turns off page formatting
CFLAGS = -I./ -c -fno-common -O0 -g -Wa,-adnhls=$*.lst -Wall
AFLAGS = -ahls -mapcs-32
LDFLAGS = -Map ${TARGET}.map -T${LDSCRIPT}
CPFLAGS = -O ihex
##ODFLAGS = -x --syms
ODFLAGS = -h -S -t
#LIBS = -lc -lgcc

SRCS = main.c

OBJS = $(SRCS:.c=.o)

all : depend
make ${TARGET}.hex sizes list

clean :
@-rm *.o *.lst *.dmp *.hex *.map *.out *.elf *.bin > /dev/null 2>&1
sizes : ${TARGET}.elf
${SZ} ${TARGET}.elf

list : ${TARGET}.elf
${OD} ${ODFLAGS} ${TARGET}.elf > ${TARGET}.lss

program : ${TARGET}.hex
lpc21isp ${TARGET}.hex /dev/ttyS0 38400 12000

${TARGET}.elf : ${LDSCRIPT} crt.o ${OBJS}
${LD} ${LDFLAGS} -o ${TARGET}.elf crt.o ${OBJS} ${LIBRARIES}

${TARGET}.hex : ${TARGET}.elf
${CP} -R.dma -O ihex ${TARGET}.elf ${TARGET}.hex

${TARGET}.srec : ${TARGET}.elf
${CP} -O srec ${TARGET}.elf ${TARGET}.srec

${TARGET}.bin : ${TARGET}.elf
${CP} -O binary ${TARGET}.elf ${TARGET}.bin

crt.o : crt.s
$(AS) $(AFLAGS) -o crt.o crt.s > crt.lst

$(OBJS) : %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

depend :
@cp Makefile Makefile.bak
@awk '/# .Id/,/^# DO NOT DELETE/' Makefile > Makefile.new
@${CC} ${CFLAGS} -MM ${SRCS} >> Makefile.new
@if ! diff Makefile Makefile.new > /dev/null 2>&1 ; then \
mv Makefile.new Makefile; \
else \
rm Makefile.new; \
rm Makefile.bak; \
fi

# DO NOT DELETE (Dependencies follow)
main.o: main.c lpc214x.h
-----------------------end of the make file ----------------------

I wonder about the LOCATION variable ending with a "/" since when it is used the lines begin with a "/".

Also I probably need to post an inquiry to those that use the Code Scourcery libraries to see what paths they use.

--- In l...@yahoogroups.com, "rtstofer" wrote:
>
> --- In l...@yahoogroups.com, "Bruce" wrote:
> >
> > 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.
>
> You might be surprised at the results. Most of the fancy integrated environments 'help' you be encapsulating configuration information in dialog boxes and such. You can spend days trying to figure how to build the most simple project.
>
> I prefer a simple Makefile. Everything I need to know about my program is right in front of me. The startup code, the C code, the linker script and the Makefile. Nothing is hidden.
>
> But that's just my preference. Frankly, I think it is just because I am old and don't do well with change.
> >
> > 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.
>
> I don't think trying to copy an Eclipse project will be beneficial because I fear the project files have embedded full path names. I don't know that but I believe it to be true.
>
> I just posted ARM2148Timer.zip to the Files folder. It is a complete set of files for a timer that I didn't write. The code itself is not important.
>
> Unip the file to a temporary directory. Do NOT unzip it inside your workspace directory. Files have to be imported into the workspace. Copying won't work. Although you can copy between projects while using Eclipse to do the work.
> In Eclipse: File -> New -> C Project
> Enter a Project name
> Highlight Makefile project
> Ensure that -- Other Toolchain -- is highlighted
> Click Finish
>
> .. you now have an empty project
>
> Right click on the project in the Navigator panel - on the left of my screen.
>
> Select Import (from the flyout menu) -> File System -> Next and browse to find your temporary directory - you won't select any files just yet. Click OK after you have found the directory.
>
> A dialog will pop up with the directory in the left panel and a list of files in the right panel.
> In this case, click the Select All button and click Finish.
>
> Now if you expand the project in the Navigator panel, you will see all of the files plus an Includes directory that Eclipse creates. I don't know why...
>
> Double click on the Makefile and look at the way I specified the LOCATION of the arm toolchain and look a little farther down where I specified the GCC version in ARCHIVE2. Fix these for your system.
>
> Sometimes the path is /usr/local because the files are in /usr/local/bin But I don't have my machine set up that way.
>
> Select Project -> Properties -> C/C++ Build
> On the Builder Settings tab, check Use default build command. The Build command should be 'make' and the Builder type should be External builder. Down in the Build directory box there should be a path to your project.
> Click OK
>
> Click the Build All icon (piece of paper with 010) or Ctrl-B. The project should get built.
>
> This same process will work with the Logomatic code I posted a few days ago. I have since deleted it. If you need it, just ask. I can repost it.
>
> A slight hint: once you unzip the files, you can drop to a command line and edit the Makefile as described above. Then you can run 'make' from the command line and the project should get built.
>
> This should also work after you import the files into the workspace. All Eclipse does for these Makefile projects is invoke make with a suitable command line. If it builds from the command line, you know you are on the right track.
>
> If, after all this, you still can't get it working, drop me an email. I am using the Ganymede version of Eclipse and there might be some differences with what you are using.
>
> Richard
>

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 7 12:38:47 2009



--- In l...@yahoogroups.com, "Bruce" wrote:
>
> Ok, I downloaded the Timer project and edited the make file for the paths. I use linux so I also use Code Sourcery's arm-none-eabi. When I did a build all I still got the error:
>
> Description Resource Path Location Type
> make: *** No rule to make target `all'. ARM2148Timer line 0 C/C++ Problem
>
> I am guessing that I have a path problem so I will post my make file here:

I'm not sure about the error. It SEEMS as though 'make' can't find the Makefile. It's not complaining about not finding the compiler. It hasn't gotten that far. It IS complaining about not finding the target 'all' which is clearly present in the Makefile. Are you running 'make all' from the command line? As 'all' is the first target, you don't need to specify it. Just 'make' should work.

If you are running from Eclipse, one of the dialog boxes I mentioned yesterday, C/C++ Builder, there is a place to indicate the location of the Mekefile. It normally defaults to the right thing. Normally there is a macro defining the workspace follow by /.

If you aren't running 'make' from the command line, you should try it. If it won't compile from the command line, it certainly won't compile from within Eclipse.

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce Lindsay - Nov 7 15:07:37 2009

Well, I found the problem. I didn't understand the project structure.
When the import occurred the top folder came in with it. This apparently
caused a reference problem (obviously, but not so obvious to me).

So my tree looked like:

ARM2148Timer
->includes
->ARM2148Timer
-crt.s
-lpc214x.h
-main.c
-Makefile
->Makefile

The "->" were top level files and folders. So when I got rid of the
extra "ARM2148Timer" folder and the extra Makefile it cleared right up.
So, I appreciate your (and everyones that messaged) help. Such a simple
thing as importing was messing me up. Plus this example gives me some
stuff to look at and study. Once again thanks.

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 7 15:31:03 2009

.
> So, I appreciate your (and everyones that messaged) help. Such a simple
> thing as importing was messing me up. Plus this example gives me some
> stuff to look at and study. Once again thanks.
>

Please don't look at that project as any kind of example. The main() code is problematic, the interrupt functions don't have prototypes and there is a redundant MSR instruction in the startup code that changes the chip to user mode (just before the branch to main().

Although the code works, it is useless as an example. Whatever you might learn is wrong!

What you REALLY want to get is at www.jcwren.com/arm. JC has written some outstanding code for the LPC2148 surrounding FreeRTOS as there is example code for all of the peripherals. You will have to 'import' the project but that should be easier now that you see how it is done.

I would also recommend you download the ARM2106BlinkingLED.zip code from the Files folder as it has the interrupt wrapper code that allows you to define your interrupt handlers as normal functions. You REALLY want to do it this way if you expect interrupts to nest (or work at all).

Congrats...

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce Lindsay - Nov 7 18:55:07 2009

Yeah, I'll get that example because now when I try to build the
Logomatic code it has a problem with the irq.c. I think the problem is
in reference. I imported it into eclipse as a C Makefile project but I
think it needs the arm toolchain. But, I am much closer and a bit
hopeful now. Thanks.
------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - Bruce Lindsay - Nov 8 22:50:29 2009

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.

***************************************************************************************
***************************************************************************************

# $Id: Makefile,v 1.0 2006/04/06 06:55:34 RTS Exp $

DATE = `date "+%c"`
NAME = LPC2148_Logomatic_V2
TARGET = Logomatic
LDSCRIPT = lpc2148-FLASH.ld

LOCATION = /home/bruce/CodeSourcery/Sourcery_G++_Lite/

CC = ${LOCATION}/bin/arm-none-eabi-gcc
LD = ${LOCATION}/bin/arm-none-eabi-ld
AR = ${LOCATION}/bin/arm-none-eabi-ar
AS = ${LOCATION}/bin/arm-none-eabi-as
CP = ${LOCATION}/bin/arm-none-eabi-objcopy
OD = ${LOCATION}/bin/arm-none-eabi-objdump
SZ = ${LOCATION}/bin/arm-none-eabi-size

ARCHIVE1 = ${LOCATION}/arm-none-eabi/lib
ARCHIVE2 = ${LOCATION}/lib/gcc/arm-none-eabi/4.3.3
ARCHIVE3 = /home/bruce/ARMworkspace/Logomatic/lib
ARCHIVE4 = /home/bruce/ARMworkspace/Logomatic/LPCUSB
LIBRARIES = -L${ARCHIVE1} -lc -lg -L$(ARCHIVE2) -lgcc -L$(ARCHIVE3)
-lgcc -L$(ARCHIVE4) -lgcc

# in -adnhls the 'd' turns off debugging info and the 'n' turns off page
formatting
CFLAGS = -I./ -c -fno-common -O0 -g -Wa,-adnhls=$*.lst -Wall
AFLAGS = -ahls -mapcs-32
LDFLAGS = -Map ${TARGET}.map -T${LDSCRIPT}
CPFLAGS = -O ihex
##ODFLAGS = -x --syms
ODFLAGS = -h -S -t
#LIBS = -lc -lgcc

SRCS = main.c

OBJS = $(SRCS:.c=.o)

all : depend
make ${TARGET}.hex sizes list

clean :
@-rm *.o *.lst *.dmp *.hex *.map *.out *.elf *.bin >
/dev/null 2>&1
sizes : ${TARGET}.elf
${SZ} ${TARGET}.elf

list : ${TARGET}.elf
${OD} ${ODFLAGS} ${TARGET}.elf > ${TARGET}.lss

program : ${TARGET}.hex
lpc21isp ${TARGET}.hex /dev/ttyS0 38400 12000

${TARGET}.elf : ${LDSCRIPT} crt.o ${OBJS}
${LD} ${LDFLAGS} -o ${TARGET}.elf crt.o ${OBJS}
${LIBRARIES}

${TARGET}.hex : ${TARGET}.elf
${CP} -R.dma -O ihex ${TARGET}.elf ${TARGET}.hex

${TARGET}.srec : ${TARGET}.elf
${CP} -O srec ${TARGET}.elf ${TARGET}.srec

${TARGET}.bin : ${TARGET}.elf
${CP} -O binary ${TARGET}.elf ${TARGET}.bin

crt.o : crt.s
$(AS) $(AFLAGS) -o crt.o crt.s > crt.lst

$(OBJS) : %.o: %.c
$(CC) -c $(CFLAGS) $< -o $@

depend :
@cp Makefile Makefile.bak
@awk '/# .Id/,/^# DO NOT DELETE/' Makefile >
Makefile.new
@${CC} ${CFLAGS} -MM ${SRCS} >> Makefile.new
@if ! diff Makefile Makefile.new > /dev/null 2>&1 ; then
mv Makefile.new Makefile;
else
rm Makefile.new;
rm Makefile.bak;
fi

# DO NOT DELETE (Dependencies follow)
main.o: main.c lpc214x.h

***************************************************************************
***************************************************************************

PS - How do you make relative library declarations in the Makefile?

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 8 23:35:32 2009



--- In l...@yahoogroups.com, 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

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 9 8:14:41 2009



--- In l...@yahoogroups.com, "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

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: eclipse and LPC2148 - rtstofer - Nov 9 9:02:53 2009



--- In l...@yahoogroups.com, "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

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )