LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 03-23-2007, 05:16 PM   #1
winterhunter
Member
 
Registered: Oct 2005
Distribution: Ubuntu Edgy
Posts: 58

Rep: Reputation: 15
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
 
Old 03-24-2007, 07:09 PM   #2
kourama
LQ Newbie
 
Registered: Sep 2006
Distribution: Mint64 w/KDE
Posts: 17

Rep: Reputation: 0
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.
 
Old 03-26-2007, 11:30 AM   #3
winterhunter
Member
 
Registered: Oct 2005
Distribution: Ubuntu Edgy
Posts: 58

Original Poster
Rep: Reputation: 15
Thanks a lot!
 
  


Reply

Tags
arm, debug


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
crosscompiling grub tilman1 Linux - Software 0 03-11-2007 11:32 AM
Need help compiling for microcontroller jorisb Linux - Software 0 01-12-2006 04:16 PM
crosscompiling gcc error Alotau Linux - Software 4 06-22-2005 04:39 PM
microcontroller programming pantera Programming 4 03-18-2005 08:37 PM
Software Sources Manager, how to add installation cd sources after deletion Lakota Mandriva 1 10-23-2003 12:39 AM


All times are GMT -5. The time now is 11:37 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration