LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Crosscompiling C sources for an OS-less ARM microcontroller - is it possible? (http://www.linuxquestions.org/questions/programming-9/crosscompiling-c-sources-for-an-os-less-arm-microcontroller-is-it-possible-540026/)

winterhunter 03-23-2007 05:16 PM

Crosscompiling C sources for an OS-less ARM microcontroller - is it possible?
 
Hi everyone,

I'm currently into microcontrollers (PICs for most applications, but I'm going to start using an ARM7 as soon as all the PICs which will act as peripherals for my system are up and running).

So the question is: is there some way to compile/program/debug an ARM microcontroller (that will not be running any OS) using Linux? I know there are some GNU toolchains (GCC based) floating around for windows, as well as some JTAG (using a wriggler compatible interface) drivers for gdb - again for windoze.

If I can avoid booting that particular OS for these tasks, I will be a grateful man!

Thanks,

Gonzalo

kourama 03-24-2007 07:09 PM

Yes, in fact, that is/was sort of what I'm doing right now.

you can get a nice pre-built binary for all the gcc stuff you'll need from:
http://www.gnuarm.com/resources.html

To build a binary that doesn't include any standard libs, use the -ffreestanding gcc option.

Also, if you're building for an embedded system, you'll need a linker script that will put everything in memory where you want it.

If you download FreeRTOS, it includes several demos including one for the atmel at91sam7x-ek evaluation board with GCC stuff and a linker script for you.

http://www.freertos.org/

Of course, if you really don't want to use an OS at all, you'll end up doing a lot of extra work depending on what you want it to do.

For testing your arm binary, you can use the free skyeye emulator:
http://www.skyeye.org/index.shtml

Lesseee, what else..Oh, the binutils might not be included in the gnuarm package, so you might have to grab the source and build them yourself from gnu.org. Don't forget to use the -tarm-elf target option.

There, that should get you up and running.

winterhunter 03-26-2007 11:30 AM

Thanks a lot!


All times are GMT -5. The time now is 08:46 PM.