/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / build parameters and processor switches with codesourcery ?

Username:     
Password:     
             

Forum
  • Index
  •  » STM32 Family
  •  » build parameters and processor switches with codesourcery ?

# 1   2008-03-17 06:56:20 build parameters and processor switches with codesourcery ?

graham
Member
Registered: 2008-02-23
Posts: 32

build parameters and processor switches with codesourcery ?

Hello, I have the above installed, but it won't compile under gcc for option -mtune=cortex-m3, nor on -march or -mcpu .

Is codesourcery arm-none-eabi specifically for the cortex-m3, or a more generic compiler ?
If generic, I need command line options, or *.c file directives to notify the compiler...



I'm quite used to assembler on various 8 bit products, and to VB and more recently python, but I'm a complete newbie to arm, and seriously considering C this time, although I see it as rather bloated compered to assembler...

The info I've searched out on the net does not seem to address this issue well for the newcomer, and I've experienced extreme frustration with ride7, under W2K, which I don't like running anyway. Ride7's commandline will flash program for me.. but I need to compile !

I've checked out a lot of Linux free IDEs, and Geany is looking most promising at the moment, as it is easily configurable to change compile command line options, and it's small, fast to load, manages projects, and has code folding to hide currently irrelevent code while larger scopes are checked out.

Geany configures under Build/Set Includes and Arguements, i.e.
arm-none-eabi-gcc "%f",
or
arm-none-eabi-gcc "%f"
for assembly, but as above, I can't find how to specify the cortex-m3.


Any help much appreciated.. this has been driving me nuts, since the arrival of my stm32circle around 3 weeks ago !
Graham.

Offline

 

# 2   2008-03-17 06:58:54 build parameters and processor switches with codesourcery ?

graham
Member
Registered: 2008-02-23
Posts: 32

Re: build parameters and processor switches with codesourcery ?

Whoops... typo !
arm-none-eabi-as "%f"   <---- "as" for assembly

Offline

 

# 3   2008-03-17 08:25:47 build parameters and processor switches with codesourcery ?

lionel
Member
From: Grenoble, France
Registered: 2007-07-24
Posts: 71
Website

Re: build parameters and processor switches with codesourcery ?

Hello Graham,

CodeSourcery GCC is a "more generic" compiler. It is designed for ARM devices but is not specific to Cortex-M3, so you will need options.

Ride7 outputs the command lines executed in the Build Log pane. I suggest you have a look there, take as a basis the first line of a .c file compilation process (the other commands are needed to generate other formats or pass information to Ride, but the real compilation is the first command-line). remove the backslash at the beginning of the line, the rest should be a valid command-line. You will see the options there.

Lionel

Offline

 

# 4   2008-03-18 04:46:40 build parameters and processor switches with codesourcery ?

graham
Member
Registered: 2008-02-23
Posts: 32

Re: build parameters and processor switches with codesourcery ?

Thankyou Lionel,
I'm used to the processor specific information being hidden either in the executable compiler, or with an integrated installer. (as with ride7)

The C installs I tried on Linux so far lack the expectet polish re the cortex-m3 ... Grrr !

I'm sure this will continue changing for the better.. :]

Offline

 

# 5   2008-03-21 12:34:26 build parameters and processor switches with codesourcery ?

graham
Member
Registered: 2008-02-23
Posts: 32

Re: build parameters and processor switches with codesourcery ?

For others going down this route, I finally have a compiler working:
Originally I'd downloaded the arm-none-eabi Codesourcery compiler, which was about 29 meg zipped,
It would not recognise cortex-m3 with -march=, -mtune= or =mcpu= command line options.

I had to download the arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 file (92.1meg, zipped), and then my -mtune=cortex-m3 switch was recognised.

I can now sucessfully compile C files with [ arm-none-linux-gnueabi-gcc -mtune=cortex-m3 -mthumb "%f" ] as my compile line,
under Geany, a lightweight free Linux project editor.

It was the 28'th of March when I got my STM32primer, so around 3 weeks to get this far... very frustrating ! would much rather have spent that time coding and seeing results.

Offline

 

# 6   2008-03-22 13:41:32 build parameters and processor switches with codesourcery ?

Stewee
Member
From: Dorset/England
Registered: 2007-10-11
Posts: 47
Website

Re: build parameters and processor switches with codesourcery ?


( Please Give Blood http://www.blood.co.uk >50% can.  5% do. )

Offline

 

# 7   2008-03-23 09:28:59 build parameters and processor switches with codesourcery ?

graham
Member
Registered: 2008-02-23
Posts: 32

Re: build parameters and processor switches with codesourcery ?

Thanks Stewee, I have been looking at that one already. I've even been looking at the shell commands to try to figure out what the makefile is doing.

Lanckon has it set for his personal build environment, but I couldn't get that version of codesourcery to work, and had to download the arm-none-linux-gnueabi one instead, which DOES recognise the cortex-m3. Critical !

So,  I have been considering tweaking the makefile to work for me, but I'm still a C newbie, and it's slow going, learning the shell scripting language + C + the compiler options, AND selecting the right build environment for the STM3201 as well. All the STM32circle apps I've seen, seem overlong in compiled code size, and I'm wondering if I should just stick with assembler, as I know it best, and it's certainly the way to go if you need an "expert solution" versus platform migratability.

Offline

 

  • Index
  •  » STM32 Family
  •  » build parameters and processor switches with codesourcery ?

Board footer