SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By dan_spark
#80207
Hi,

Can anyone explain to a Linux noob how to get the gnu arm gcc installed? I followed the instructions from this link


http://www.doctort.org/adam/nerd-notes/ ... -p256.html

but can't get it to work with Suse 11.1 I'm pretty sure I'm follwing the step correctly but never end up with gcc-arm-elf for compiling and it never generates a /usr/local/arm7 directory.

I have been able to work with the LPC parts using winarm but wanted to migrate to linux. Any help is much appreciated.

Thanks Dan
By carrierwave
#80222
Hello, I noticed your post as I was editing mine. I also looked at that page when I was just getting started, and was baffled for a while. I have written up a full tutorial on this at carrierwave.wordpress.com, and there is one post specifically devoted to setting up the toolchain (and most of the other stuff, while targeted at the AT91SAM7S256, is also applicable). aifrog.com also has some good information.
By dan_spark
#80228
I quickly reviewed your posts before and saw the reference to exclipse so I shyed away because it was too many things at once. I looked at your link though and saw some promising stuff so I'll have to read into it further. If I can get the CLI for compiling ARM then I can move on to getting and IDE going.

Just as a quick test, could you tell me if you're able to compile the firmware that is on Sparkfun's page for the MP3 development board? That's my test case since I am using the LPC2148 as well so that would be helpful. I have been able to compile it using Winarm.

Thanks for the info.

Dan
By carrierwave
#80230
I tested everything via CLI first before getting it working in Eclipse, so there should be no problem if you really don't want an IDE.
I found an LPC2148 project in the OpenOCD demos and it built fine, after changing the names of the binaries from arm-elf-gcc to arm-none-eabi-gcc, and so on, and lowercasing the header file name in the Makefile. I can't test it, of course, but it had no warnings.
You may be out of luck on the MP3 firmware - the Makefile seems to be specifically written for WinARM. I am not yet advanced enough to convert it. I assume there would be no issue if you fixed the Makefile, but it looks like a thorny problem.
By hsutherl
#80232
The gcc 4.0.1 distribution based at gnuarm.com (I don't see a linux binary at gnuarm.org) worked ok for me on Ubuntu 8.10 and 9.04. (Only applicable for x86_64) I just unpacked it into usr/local/armxxx and it was ready to run. ( I guess I do have an environment setup script I run before each session.)

Later on, with the help of the people at the gnuarm user group, I was able to build a newer version, for which the source was available at gnuarm.org. I built the newer version whilst trying things at random to get openocd to work for me, not because of any problem with gcc 4.0.1.

There are indeed significant differences from distro to distro with makefiles and header files. I've been in way over my head a few times already trying to convert projects from Keil or IAR.
By dan_spark
#80235
I first attempted to compile the toolchain but either I had a version that wasn't compatible or I was doing something wrong. Either way, I nver ended up with the desired target at location /usr/local/arm7 so I then tried a binary and unpacked it at the desired location. I was then able to invoke the gcc-arm-elf compiler with the makefile but errors occured. I guess this may be from what carrierwave mentioned about makefiles being different from toolchain to toolchain.

I think this means that I at least have the compiler running. I'll take a peek into the makefile to see if anything obvious pops out but I'm far less Linux experienced than carrierwave so this may be futile. That was why I was hoping he was able to compile the sparkfun project.

As a side, I did try the eclipse route but couldn't get past some of the errors. I'm pretty sure I never had the compiler set up correctly but when I'm ready to tackle that again I'll be back posting about that next ;)

Thanks for the feedback.

Dan
By carrierwave
#80236
You flatter me by calling me "experienced" - I just run into twice as many errors as most people ;-).

But, I have successfully built it! (Fighting the compiler and winning feels so awesome!) The key was that on Linux, case matters - remember I had to lowercase one of the names of the header files in the OpenOCD demo project to get it to compile?. Well, just changing the cases of the header files included in main.c (and all the other files, argh...) fixed it right up. Very tedious but easy to do.
By lehmanna
#80248
carrierwave wrote:Well, just changing the cases of the header files included in main.c (and all the other files, argh...) fixed it right up. Very tedious but easy to do.
You know there's 'sed' & friends? :D :D
By gdisirio
#80249
Codesourcery has a free GCC package for Linux, no need to compile anything. It works correctly with Eclipse and the Zylin plugin.

Giovanni
By millwood
#80340
this is why I went with Keil MDK: rather than spending time to get the IDE/compiler combo to work, as you demonstrated here, Keil worked for me right out of the box and allows me to focus on my program, not the tool itself.