Author Topic: Setup C::B for GNU ARM GCC Compiler  (Read 9154 times)

Offline krgh

  • Single posting newcomer
  • *
  • Posts: 7
Setup C::B for GNU ARM GCC Compiler
« on: November 07, 2006, 01:00:11 am »
Hi,

  Earlier i was using Codewarior for my project work with GNU ARM Toolchain & ARM AXD. Then i swiched to C::B. In C::B i am unable to compile my codes that was easily compiling with Codewarior. Below are my settings in C::B

1. C::B Autodetected GNU ARM GCC Compiler
2. C::B Compiler Program Files Auto Detect Successfull.
3. C::B Compiler Directories Auto Detect Successfull.
4. C::B Compiler Flags -g -01

   Teh issue is When i try compile non of the Assembly commands like __irq, __inline, __asm compiles. exm = void __irq IRQ_Handler(void). I get an error when i compile: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'IRQ_Handler'

   So Now i have to write code in C::B & then go back to codewarior for compilation. Kindly help me to setup my C::B so that i can do both in C::B

  Sorry if posted in wrong section.

Regards
Gururaja
« Last Edit: November 07, 2006, 05:30:42 am by krgh »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Setup C::B for GNU ARM GCC Compiler
« Reply #1 on: November 07, 2006, 09:10:01 am »
GNU ARM Toolchain & ARM AXD [...]
I don't have knowledge about that compiler but did you verify that (although it was auto-detected) the path is setup correctly? It *could* have happened that C::B finds let's say the MinGW gcc compiler and assumes this is the one for ARM. Please re-check your compiler setup (the "Programs" and "Additional path" tab).
With regards, Morten.
Ps.: If there is no other "expert": Could you post a link where to d/l the compiler and a "hello world" demo showing that issue?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

wassily

  • Guest
Re: Setup C::B for GNU ARM GCC Compiler
« Reply #2 on: November 07, 2006, 09:19:50 am »
Hi,

In my own experience I found out that changing between different gnu tool chains can give some problems, even if you use the tool chain of the same vendor, but with another version of the gcc compiler.

I read somewhere that __irq is compiler specific and it isn't consistently supported by gcc. So some vendors of tool chains will support it and others will not. So maybe you have to find the right directives for your toolchain.

This is a forum especially for the GNU arm toolchain. Maybe that you get a better answer if you post your question over there because I'm not really an expert on those matters.

http://tech.groups.yahoo.com/group/gnuarm/

Regards,

Wassily

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Setup C::B for GNU ARM GCC Compiler
« Reply #3 on: November 07, 2006, 10:19:56 am »
You cannot expect things like that to work between compilers. The best way would of course be to write compiler-independent code in the first place, but it's too late for that now, you've already written it.
So the second best option if you want to use Code::Blocks is to set up the IDE to compile your program with the CodeWarrior compiler.

Last time I used CodeWarrior was around 1996-97, and that was on BeOS/PowerPC, too... so that is not very helpful. However, I'd be very surprised if they don't provide a documentation of their build tools. Actually you can hardly sell a compiler without providing docs.
With a little luck, they have commandline options similar to gcc or msvc, too. If you can find out about these, integrating the compiler should not be too much hassle.

EDIT: Oh wait... did not read properly once again, stupid me. You already use ARM :oops:
But it still boils down to the same thing, configuring the thing properly. If given the same options as in CodeWarrior, it should work in Code::Blocks, too.
« Last Edit: November 07, 2006, 10:23:12 am by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline krgh

  • Single posting newcomer
  • *
  • Posts: 7
Re: Setup C::B for GNU ARM GCC Compiler
« Reply #4 on: November 07, 2006, 12:08:35 pm »
Hi all,

 Thanks for the Replies.

      To Mr MortenMacFly - I clearey Verified that the Directories are properly detected. I Downloaded the GNU ARM GCC Compiler from http://www.gnuarm.com/. It works nicely with the Metroworks CodeWarrior. I have been working on that for last few months. No issues with that. i get this issue only with C::B.

 TO thomas  - Code warrior is an IDE. It uses GNU ARM GCC Compiler. I believe it auto detects the the compilers settings automatically.
 
   To give out more details I am working on eCos & use GNU Arm GCC Compiler & also Cygwin alongside. I write my Standalone code in codewarrior & compile in the same with GNU ARM GCC Compiler attached to it. Then run with AXD. This setup works fine. I want use C::B for this & replace Codewarrior all together but unable to setup the compiler settings.

Any help is really appreiciated

Regards
Gururaja

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Setup C::B for GNU ARM GCC Compiler
« Reply #5 on: November 07, 2006, 12:17:49 pm »
I have already compiled code with the GNUArm tools at www.gnuarm.com (or www.gnuarm.org), but that was regular c++ code. All that went well. I have no idea on how to make it compile assembler code in the source files.

Can you check in codewarrior what command lines it might be executing. Or can you export a makefile from CodeWarrior ? That might give us some hints. Because basically it's just specifying the correct command line options to arm-elf-gcc ...

[EDIT] : to see what command line's are generated by CB, go into Settings->Compiler and Debugger -> choose from the drop down list the GnuARm and on the others tab change the selection in the drop down list from "Task Description" to "Full command line"
« Last Edit: November 07, 2006, 12:20:15 pm by killerbot »