EmbeddedRelated.com
Forums
Memfault State of IoT Report

eclipse and LPC2148

Started by Bruce November 1, 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.

An Engineer's Guide to the LPC2100 Series

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


-----------------------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..., "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 /<project name>.

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
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.
> 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
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.
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.



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

Memfault State of IoT Report