cancel
Showing results for 
Search instead for 
Did you mean: 

C/C++ compiler provided

hg8lhs
Associate
Posted on July 17, 2008 at 06:26

C/C++ compiler provided

8 REPLIES 8
hg8lhs
Associate
Posted on May 17, 2011 at 12:39

Hello!

I downloaded and compiled the latest (4.3.1) GCC code to use it as a cross compiler for ARM Cortex-M3 based microcontrollers (primarily STM32xxx). I would need some help to test it. If somebody has any notice about the compiler, please let me know.

Of course, I'm not a programmer, so if you have a problem with the compiler itself, please write an email to the maintainer.

If you can help me to make a well-usable compiler suite for Linux, please write me an email. My address is:

mailto:hg8lhs@gmail.com

Thank you very much.

st3
Associate II
Posted on May 17, 2011 at 12:39

Quote:

Of course, I'm not a programmer

So why are you playing around with a compiler?! :o

lanchon
Associate III
Posted on May 17, 2011 at 12:39

I guess he meant he's not a GCC developer. but I don't understand what he's trying to do, isn't there a codesourcery for linux?

paul
Associate II
Posted on May 17, 2011 at 12:39

http://gcc.gnu.org/gcc-4.3/changes.html

The release of gcc 4.3 mentions:

Compiler and Library support for Thumb-2 and the ARMv7 architecture has been added.

Does this mean that GCC natively supports the Cortex-M3? What does the -mcpu=cortex-m3 flag actually do with codesourcery's version of GCC.

st3
Associate II
Posted on May 17, 2011 at 12:39

Quote:

Does this mean that GCC natively supports the Cortex-M3?

I guess it must - since Raisonance and others are also using GCC for Cortex-M3 support...

disirio
Associate II
Posted on May 17, 2011 at 12:39

Correct, GCC 4.3.0 does support the Cortex-M3 (and of course the STM32), I tested it in my project and it seems to work correctly.

If you want to give it a try there is a WinARM test build that includes GCC 4.3.0. You can download it here:

http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/

(the link is in the middle of the page, it is a 37MB download).

You need to use the options -mcpu=cortex-m3 -mthumb

I also recommend the options -O2 -fomit-frame-pointer -mabi=apcs-gnu in order to get faster and smaller object code.

regards,

Giovanni

---

ChibiOS/RT

http://chibios.sourceforge.net

lanchon
Associate III
Posted on May 17, 2011 at 12:39

it'd be nice to know what version of codesourcery was merged into GCC 4.3.0. maybe it's better to keep using codesourcery for a while, it's probably more mature code, don't you think?

disirio
Associate II
Posted on May 17, 2011 at 12:39

I tested both codesourcery and GCC 4.3.0. Both seem to do quite well in generating Thumb2 code even if some optimizations seem to be missing compared to the ARM mode.

As example, the Thumb and Thumb2 modes do not perform the tail calls optimization and this often results in larger and slower code, also the stack usage is more aggressive (bad for embedded applications), this optimization is present in ARM mode.

I understand that it is not done in Thumb mode because issues with interworking, but the Cortex-M3 does not have the ARM mode so the interworking should not be a constraint and the optimization should be included.

I am sure it will mature. I am impressed overall by the quality of the GCC ARM port.

regards,

Giovanni

---

ChibiOS/RT

http://chibios.sourceforge.net