The search for the perfect ARM compiler/IDE

Hello to everyone, after getting one LPCXpresso 1768 board and one STM32-Discovery with the 100RB micro-controller, I started the my quest to find one IDE or compiler(compiling via command line is not a problem for me) that would work with both boards, or even one for each one, well, the CodeRed for the 1768 isn’t very very bad but as a size limitation although it is one nice 128Kb, after that I found Atollic TrueStudio, it doesn’t have size limits, but it doesn’t report the size of the compiled program and its pretty hard to put it working, then there is Keil with is just awful, then IAR limited to 32Kb a size that in my opinion is plain stupid, 32Kb of code in one Cortex M3 arm is plain wrong and I don’t have the money to buy an IDE that expensive, the same for Rowley that is limited to 30 days.

I haven’t yet tried Yagarto, what do you guys think of it?

And I have read a little bit about Coocox, and the arm-gcc that doesn’t have any news after 2006 (?!).

Any help in a nice and not crippled compiler that would support my two boards would be perfect, thanks in advance.

The Rowley Personal license is $150. You get a very good package with excellent support.

While the ARM-gcc website has not been active, the development of the gcc compiler for the ARM cores has been. I believe that several of the “commercial” compilers are actually gcc based compilers.

Rowley uses gcc with their own libraries and IDE.

I’m a student I cant even afford an 50€ IDE, 150€ is a LOT of money for my budget, yes I know that almost all commercial IDE’s use flavours of gcc, but its closed gcc, and I cant afford then, with is a pity :frowning:

You can download, compile, and install the gcc tools, either native if you are actually compiling on your ARM platform, or as a cross-compiler on whatever Unix-like platform you prefer. This is absolutely free, so should be compatible with your budget. I’m afraid my most recent ARM experience is all with ARM embedded in ASIC designs, but gcc has worked fine cross-compiling for those ARMs–I would hope it would work for your development boards. We do tend to compile from the command line (well, technically, I suppose, from inside make), as that is pretty much a requirement for our test and regression environment.

So, if I download the win-arm or yagarto, how can I add the specific libraries to compile code for the LPC1768 and the ST100RB(I think that this is the correct part number for the stm32-discovery board)?

Thanks for all the help provided.

Senso:
I’m a student I cant even afford an 50€ IDE, 150€ is a LOT of money for my budget, yes I know that almost all commercial IDE’s use flavours of gcc, but its closed gcc, and I cant afford then, with is a pity :frowning:

As a professional, I assessed all these compilers, including GCC and it’s for-sale IDEs, in some depth, and chose IAR and pleased two years later.

Often, students’ projects are small so you can use the free versions of IAR (or Keil), which limit size of code to 32KB. Your productivity will be much higher with one of these compilers. that means less time fighting with the compiler as a tool, more time on the assignment, and overall more time for beer and pizza.

As another data point, we went with the plain gcc route for ARM development for several projects, and we’ve been quite happy each time. We didn’t have to fight with (or really spend any significant time on) the tools, but then we collectively have a lot more gcc experience than the average student. So go figure! I wouldn’t argue against stevech’s happy experience with IAR.

Mr.Tecoist, can you explain to me how can I get the arm-gcc compiling code for the lpcexpresso1768 board?

Do I need to include the libraries/CMSIS folders from code red or from the ARM site itself?

All the help provided is highly appreciated and I will be always in debt to everyone that can help me in my “quest”.

For the LPC2103, 2106, 2138, 1751 and 1756 you can download our version of gcc and simple IDE we call MakeItC.

With some minor edits to the linker scripts you can add more devices.

We’d even open up the Tcl source for MakeItC to add more devices.

Why would we do this, well it gets more people beating on our tools, though they are pretty stable now, and gives us some exposure, you might choose one of our boards in the future.

www.coridiumcorp.com/files/setupC.exe

Hello Senso,

[first a warning - I may not have any of this right]

I don’t know if you’re aware that each of your two boards has a different proprietary JTAG-SWD interface. That is to say, the commands between the host PC and the interface are not published. So, tool vendors other than Code-Red won’t support the LPC-Link interface for your LPCXpresso unless they have paid some sort of license fee to [either Code Red or NXP or Embedded Artists or - not sure].

The ST-Link built into your STM32 Discovery is also proprietary. However, it has been around longer and a) I think it is more widely supported (by Keil, etc.), and b) I’m 99% sure the protocol has been reverse-engineered for the openOCD project. [Edit: It is the (Raisonance) R-Link that is supported by openOCD, not the ST-Link. (Maybe I should edit that 99% as well.)]

Anyway, the point here is that it may not be possible to find a free IDE with no code size limitiation that supports both of your proprietary interfaces.


The rest is directed mostly towards free tools.

Sorry I can’t give details on how to get it all working - I’ll try to provide a few bullet points. If I find a good tutorial I’ll post the link.

  • crt0.s: The CMSIS (provided by ARM) in the STM32 StdPeriphLib had a usable crt0.s for the larger STM32 parts. I don’t know if that has been updated to include one that is good for value-line parts. I don’t know about the NXP part.

  • use the appropriate compiler flags (maybe -mcpu=cortex-m3 -march=armv7-m -mfloat-abi=softfp -mthumb)

  • linker script is the hardest part imo. Start with just the linker script section of James Lynch’s tutorial (search Sparkfun for Lynch) - I think most of his excellent installation instructions may be dated. Then, the documentation for ld is more readable than I expected it to be. The linker scripts included with the professional tools have astonishing complexity - I presume this is in order to handle Linux applications, which you won’t need (yet, anyway).

  • programmer debugger and config: ok in your case this may be the hardest part. For the STM32 you might ask in the openOCD forum here on Sparkfun. Dunno re LPC-Link


General comments:

  • I agree with viskr that the Coridium tools are the simplest way to get started with arm/gcc. With their boards, it just works right out of the box. Modify the demo program, build, download, and run. Then you can examine the gcc directory structure, the config files, crt0.s and so forth to understand how they got it all working. However, since you already have two (cortex) dev boards, this might not the best approach for you.

  • For an up-to-date pre-built command line arm-gcc toolchain, I think codesourcery is the premier site

Yes codesourcery is the premium source for prebuild toolchains. Even if you are builing the chain on your own, it’s often wise to look at version number they package (to avoid release with bugs or not well tested).

You can also use eclipse with CDT as an IDE. Not my prefered choice, but it’s here and free. ARM toolchains are well supported also (thanks to Android).

Then you need a startup file + linker file to fit your boards. You can also look at a rtos, small one, this way you will have everything on hands for startup. I did this with ChibiOS and an unsupported STM32 board. A couple of modification after I had my code working.

You endup with two choices:

  • An integrated and supported IDE which support your board/tools: you won’t have to look under the hood for 99% of the time.

  • You do everything by yourself or use free tools: you will have to look under the hood, but in the end it’s a great knowledge to have and can be usefull in some tricky situation (who said compiler bug?).

I don’t get this toolchain-build idea. Does a carpenter first build his hammer and saw? Does his competitor do so as well or does he buy them with the seller’s assurance of durability, then amortize the cost over many projects?

(the student/hobbyist may be exceptions - but only where the free limited versions of IDEs are inadequate. Free GCC when plug and play- ready to use, is a durable tool; WinAVR for Atmel is a great example, however Atmel pulled the funding for the toolmaker - a classic).

After some search around the internet I fount the openPilot project [ http://wiki.openpilot.org/Flight_Softwa … _Toolchain ] that looks to have some write-ups about setting a tool-chain based in the CodeSourcery, I know that the programmers of both my boards are proprietary, if I understand correctly openOCD is an JTAG programmer right(?) I will in the future get either one of those or maybe the JTAG programmer that is used by the openPilot project, or even another one, if I understand correctly one JTAG programmer will work in my two boards, right?

Actually I’m working in a robotic football team in my university, and they use a lot of linux and a bunch of custom tools, maybe in the future they could help me getting the gcc compiling some code, there are some linux gurus in there.

One more thing, Mr. hsutherl and Mr. mac, both of you talk about custom files and the like, can I have the compiler working for more than one target CPU, right?

Thanks a lot to all of your sir’s, you are indeed great gurus in this area and a great knowledge source’s. :shock:

Using a codesourcery toolchain is as simple as a tar command (on linux).

Building a gcc toolchain is something a little more tricky. Having it build is only a small part from it, having good binutil/gcc/lib versions is the real part.

I agree that most people never need to do this, except student because it’s a very valuable knowledge (it’s mandatory to know how a toolchain works this if you want to be hired where I work). Some linux distribution (like gentoo) make the toolchain building an easy task.

Setup a full IDE system with prebuild toolchain and eclipse with pluggins is a matter of an hour.

The toolchain is only a compiler/linker and sometime C library for a given architecture,ie familly of processors for short, like arm. You can use the same toolchain with arm processors from ST, NXP or other for example (unless the arm familly variant is not supported by the toolchain). It’s like GCC for x86: you can build code from i386 to the latest core familly of processor.

Then you need additional support: additional library support, board support files (like startup file and linker files).

IDE packages all this with they own build system/debugger/editor, I do not like this approach myself as I mainly worked on projects that do not fit this approach (and being also an emacs addict).

For the JTAG, it’s more or less used as a debug and programming interface. In fact it is a very low level interface to the chip, but it’s another story.

You can use it for programing, but it’s primary use is debugging. For programming, a bootstrap on usb/serial is often easier and faster to use.

OpenOCD allows to link you board to GDB debugger, through the JTAG interface. OpenOCD needs to know how to access your jtag interface. I use myself a embeddedproject jtag interface which is well supported and fast enough for my use, and it’s cheap also.

OpenOCD allows also to program your board thought script.

OpenOCD itself is very painful to configure: very low level, configuration changes between major versions (making some examples found on the net obsolete).

Wow, great detailed info mr.Mac, thanks for the sharing.

I have already bookmarked this topic, for now I’m short in funding so I wont buy any JTAG soon, so I will just stick to the Code Red LPCXpresso IDE and use my LPC1768 board, but I cant even get my feet wet in the ARM world, because the only blinky included in the Code Red IDE is for the 13xx micro-controller and mine is different and so I cant even manage to make a led blink :frowning:

Are there any tutorials/blog posts about this?

Or an hint how to acess the GPIO pins.

EDIT:

After some more tinkering, I think that I have found the essential thing, all the defines for each processor is inside the CMSIS files that are provided by each manufacturer, finally I can see some light!

I have also found this:

http://bitbucket.org/jpc/lpc1768/src/

Looks like a good start to the all glorified blinky.

Here I am again at it, sorry for being so boring, but I want to really understand this…

After all this help I still dont really know what to do/choose, using a simple compiler like the CodeSourcery I need to create makefiles and I dont know really how to do that, I cant even create makefiles for an avr project :frowning:

For the LPCXpresso there is the codered IDE that compiles up to 128Kb, thats more than enough for what I do, but I think I will chose the STM32 arm’s because I can get free samples from then and if I understand correctly they have a serial bootloader in a ROM memory, so I dont need a JTAG programmer(at least not essential, but I’m following the BusBlaster project and will get one when they are good to use :wink: )

So, I think that one of the most complete guides about setting up a toolchain for STM32 arms is the wiki of the OpenPilot project:

http://wiki.openpilot.org/Flight_Softwa … _Toolchain

Its all very well explained, but I dont really understand if the makefiles are handmade or if the Eclipse IDE takes care of that, and this brings me to my other option, which is the Attolic True Studio, a friend of mine as already shown me how to edit a small config line and add the Yagarto files so the Attolic True Studio will give out the build-size and some other small things, that makes it almost perfect, but I like to know what is going on, so maybe I should try the tutorial from the OpenPilot guys, but then again, makefiles and not really knowing how to even make a simple blinky because I dont know what files I should include to have the CMSIS and the registers definitions up and running for each arm model is intriguing me.

I also found this tutorial and its very detailed, but again the problem of the makefiles is confusing me, even compiling trought the command line is a mystery for me :frowning:

WinARM is free.

I think you’ll find more example code for NXP than ST.

As a newbie, did you consider mbed?

stevech:
WinARM is free.

I think you’ll find more example code for NXP than ST.

As a newbie, did you consider mbed?

AFAIK the Standard WinARM doesn’t support Cortex (Thumb2) (the last beta might)

And Martin Thomas stopped with a comment that even he now uses codesourcery.

The “dropin” replacement for WinARM would be Yagarto

http://www.yagarto.de/

As codesourcery doesn’t include arm-insight (it does include gdb).

I usually snip arm-insight from the yagarto package for windows.

On linux it’s quite easy to build arm-insight.

I have an x64 machine , and wasn’t sure the standard codesourcery linux binaries would run on a 64-bit. So i just build codesourcery from source (Ubuntu 10.04LTS) using this script https://github.com/jsnyder/arm-eabi-toolchain

That was easy :smiley:

Btw: I prefer Code::Blocks , as i find Eclipse to heavy

/Bingo