Reply by rtstofer November 10, 20092009-11-10
--- 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

An Engineer's Guide to the LPC2100 Series

Reply by rtstofer November 10, 20092009-11-10
--- 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
Reply by Bruce Lindsay November 10, 20092009-11-10
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.
Reply by rtstofer November 9, 20092009-11-09
--- 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
Reply by rtstofer November 9, 20092009-11-09
--- 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
Reply by rtstofer November 9, 20092009-11-09
--- 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
Reply by Bruce Lindsay November 8, 20092009-11-08
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?
Reply by Bruce Lindsay November 7, 20092009-11-07
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.
Reply by rtstofer November 7, 20092009-11-07
> 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
Reply by Bruce Lindsay November 7, 20092009-11-07
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.