EmbeddedRelated.com
Forums

GCC compiler

Started by g4ndc August 19, 2010
G'day all,

I'm currently working on a MSP430 project;
Processor MSP430F2618
Compiler CCS v4.1.3

So far so good.

However: I'm trying to change compilers to the GNU msp430 port.
And I hit a number of problems.

I've solved all the usual culls such as C++ comments etc
and changed the header file thus:

/*#define CCS */
#define GNU

#ifdef CCS
/* this one for the CCS compiler */
#include "msp430f2618.h"
#else
/* this one for GCC */
#include "msp430x261x.h"
#endif

Now when I compile the include also includes at least the following.
__msp430_headers_mpy_h
__msp430_headers_gpio_h

On entry to these files the compiler complains with this error mesage:-

e:\mspgcc\msp430\include\msp430\mpy.h|18|syntax error before "asm"|
e:\mspgcc\msp430\include\msp430\mpy.h|18|ISO C forbids data definition with no type or storage class|

This pair of errors refer to the same line number [18] however there are repeats of this until the compiler gets too exasperated to print any more!

So: What should I be doing that I haven't done ??

Oh, and the compiler doen't appear to be able to embed any debug information.

Comments / suggestions gratefully received.

Del

Beginning Microcontrollers with the MSP430

Hi,

I'm not sure which version of gcc you are using (I'm using the 3.2.3).
And I'm not using the HW-multiplier (mpy.h).
In my version the line 18 of mpy.h looks like:
#define MPY_ 0x0130 /* Multiply Unsigned/Operand 1 */
sfrw(MPY,MPY_);
and thats like all the other header files (register definitions) looks like.
Additional there is no "asm" in that header.

By the way, I'm using C++ comments without any problems.

Best regards

Dirk
Am 19.08.2010 12:59, schrieb g4ndc:
>
> G'day all,
>
> I'm currently working on a MSP430 project;
> Processor MSP430F2618
> Compiler CCS v4.1.3
>
> So far so good.
>
> However: I'm trying to change compilers to the GNU msp430 port.
> And I hit a number of problems.
>
> I've solved all the usual culls such as C++ comments etc
> and changed the header file thus:
>
> /*#define CCS */
> #define GNU
>
> #ifdef CCS
> /* this one for the CCS compiler */
> #include "msp430f2618.h"
> #else
> /* this one for GCC */
> #include "msp430x261x.h"
> #endif
>
> Now when I compile the include also includes at least the following.
> __msp430_headers_mpy_h
> __msp430_headers_gpio_h
>
> On entry to these files the compiler complains with this error mesage:-
>
> e:\mspgcc\msp430\include\msp430\mpy.h|18|syntax error before "asm"|
> e:\mspgcc\msp430\include\msp430\mpy.h|18|ISO C forbids data definition
> with no type or storage class|
>
> This pair of errors refer to the same line number [18] however there
> are repeats of this until the compiler gets too exasperated to print
> any more!
>
> So: What should I be doing that I haven't done ??
>
> Oh, and the compiler doen't appear to be able to embed any debug
> information.
>
> Comments / suggestions gratefully received.
>
> Del
>
>

--
Ingenieurbo Dirk Rapp
Hard-& Softwareentwicklung

Adelhauser Str. 36
79585 Steinen

Tel.: +49 7627 923494
Mobil: +49 173 6686246



Thanks Dirk

mspgcc is installed in E:/mspgcc/msp430/bin as the default installation.
GCC = v3.2.3

IDE is installed in E:/Program Files/Codeblocks as the default installation
IDE = Codeblocks v8.02

mpy.h = v1.2
and contains, amongst others (copied from file)

17 #define MPY_ 0x0130 /* Multiply Unsigned/Operand 1 */
18 sfrw(MPY,MPY_);
I agree there doesn't appear to be any "asm" anywhere but, nevertheless the
compile thinks so....

I checked the IDE for C++ header settings but found nothing there. Anyway, it
was a compiler output
that showed up. The compiler (gcc -help indicates that the default language
setting (-v) is "C,C++"
so I would expect it to be OK. Perhaps the IDE's messing with it...

I might try it as a command line build later on. If it still complaining then
its definately the compiler

and not the IDE

'tis a mystery.....

Del
________________________________
From: Dirk Rapp
To: m...
Sent: Thu, 19 August, 2010 12:21:23
Subject: Re: [msp430] GCC compiler


Hi,

I'm not sure which version of gcc you are using (I'm using the 3.2.3).
And I'm not using the HW-multiplier (mpy.h).
In my version the line 18 of mpy.h looks like:
#define MPY_ 0x0130 /* Multiply Unsigned/Operand 1 */
sfrw(MPY,MPY_);
and thats like all the other header files (register definitions) looks like.
Additional there is no "asm" in that header.

By the way, I'm using C++ comments without any problems.

Best regards

Dirk

Am 19.08.2010 12:59, schrieb g4ndc:
>
> G'day all,
>
> I'm currently working on a MSP430 project;
> Processor MSP430F2618
> Compiler CCS v4.1.3
>
> So far so good.
>
> However: I'm trying to change compilers to the GNU msp430 port.
> And I hit a number of problems.
>
> I've solved all the usual culls such as C++ comments etc
> and changed the header file thus:
>
> /*#define CCS */
> #define GNU
>
> #ifdef CCS
> /* this one for the CCS compiler */
> #include "msp430f2618.h"
> #else
> /* this one for GCC */
> #include "msp430x261x.h"
> #endif
>
> Now when I compile the include also includes at least the following.
> __msp430_headers_mpy_h
> __msp430_headers_gpio_h
>
> On entry to these files the compiler complains with this error mesage:-
>
> e:\mspgcc\msp430\include\msp430\mpy.h|18|syntax error before "asm"|
> e:\mspgcc\msp430\include\msp430\mpy.h|18|ISO C forbids data definition
> with no type or storage class|
>
> This pair of errors refer to the same line number [18] however there
> are repeats of this until the compiler gets too exasperated to print
> any more!
>
> So: What should I be doing that I haven't done ??
>
> Oh, and the compiler doen't appear to be able to embed any debug
> information.
>
> Comments / suggestions gratefully received.
>
> Del
>
>

--
Ingenieurbüro Dirk Rapp
Hard-& Softwareentwicklung

Adelhauser Str. 36
79585 Steinen

Tel.: +49 7627 923494
Mobil: +49 173 6686246







Hi,

hm, strange.
My compiler options for the msp430-gcc.exe are (I'm using it via Eclipse
as IDE):
-DDEBUG -IC:/mspgcc/msp430/include -I"my own include path" -O2 -g3 -Wall
-c -fmessage-lenght=0 -mmcu=msp430x2618

I realised now that the mpy.h was already included with the
msp430x261x.h header file. But I
havn't checked if the HW-multiplier is realy used or not.

Good luck

Dirk

Am 19.08.2010 14:24, schrieb derek mason:
>
> Thanks Dirk
>
> mspgcc is installed in E:/mspgcc/msp430/bin as the default installation.
> GCC = v3.2.3
>
> IDE is installed in E:/Program Files/Codeblocks as the default
> installation
> IDE = Codeblocks v8.02
>
> mpy.h = v1.2
> and contains, amongst others (copied from file)
>
> 17 #define MPY_ 0x0130 /* Multiply Unsigned/Operand 1 */
> 18 sfrw(MPY,MPY_);
>
> I agree there doesn't appear to be any "asm" anywhere but,
> nevertheless the
> compile thinks so....
>
> I checked the IDE for C++ header settings but found nothing there.
> Anyway, it
> was a compiler output
> that showed up. The compiler (gcc -help indicates that the default
> language
> setting (-v) is "C,C++"
> so I would expect it to be OK. Perhaps the IDE's messing with it...
>
> I might try it as a command line build later on. If it still
> complaining then
> its definately the compiler
>
> and not the IDE
>
> 'tis a mystery.....
>
> Del
>
> ________________________________
> From: Dirk Rapp >
> To: m...
> Sent: Thu, 19 August, 2010 12:21:23
> Subject: Re: [msp430] GCC compiler
>
> Hi,
>
> I'm not sure which version of gcc you are using (I'm using the 3.2.3).
> And I'm not using the HW-multiplier (mpy.h).
> In my version the line 18 of mpy.h looks like:
> #define MPY_ 0x0130 /* Multiply Unsigned/Operand 1 */
> sfrw(MPY,MPY_);
> and thats like all the other header files (register definitions) looks
> like.
> Additional there is no "asm" in that header.
>
> By the way, I'm using C++ comments without any problems.
>
> Best regards
>
> Dirk
>
> Am 19.08.2010 12:59, schrieb g4ndc:
> >
> > G'day all,
> >
> > I'm currently working on a MSP430 project;
> > Processor MSP430F2618
> > Compiler CCS v4.1.3
> >
> > So far so good.
> >
> > However: I'm trying to change compilers to the GNU msp430 port.
> > And I hit a number of problems.
> >
> > I've solved all the usual culls such as C++ comments etc
> > and changed the header file thus:
> >
> > /*#define CCS */
> > #define GNU
> >
> > #ifdef CCS
> > /* this one for the CCS compiler */
> > #include "msp430f2618.h"
> > #else
> > /* this one for GCC */
> > #include "msp430x261x.h"
> > #endif
> >
> > Now when I compile the include also includes at least the following.
> > __msp430_headers_mpy_h
> > __msp430_headers_gpio_h
> >
> > On entry to these files the compiler complains with this error mesage:-
> >
> > e:\mspgcc\msp430\include\msp430\mpy.h|18|syntax error before "asm"|
> > e:\mspgcc\msp430\include\msp430\mpy.h|18|ISO C forbids data definition
> > with no type or storage class|
> >
> > This pair of errors refer to the same line number [18] however there
> > are repeats of this until the compiler gets too exasperated to print
> > any more!
> >
> > So: What should I be doing that I haven't done ??
> >
> > Oh, and the compiler doen't appear to be able to embed any debug
> > information.
> >
> > Comments / suggestions gratefully received.
> >
> > Del
> >
> > --
> Ingenieurbüro Dirk Rapp
> Hard-& Softwareentwicklung
>
> Adelhauser Str. 36
> 79585 Steinen
>
> Tel.: +49 7627 923494
> Mobil: +49 173 6686246
>
>
>
>
>
>

--
Ingenieurbüro Dirk Rapp
Hard-& Softwareentwicklung

Adelhauser Str. 36
79585 Steinen

Tel.: +49 7627 923494
Mobil: +49 173 6686246



Hi Del,
I'm not sure which compiler you moved to. Do a --version. I've worked
with the older 2.3.? for years and have recently moved to mspgcc4
msp430-gcc (MSPGCC4_r4-20100210) 4.4.3

The old one worked fine, this one works great. The .lst file is as clean
as a whistle. As for the hardware multiplier, it will code multiply
without it if -O0 and uses the hardware with -Os.

It works fine with eclipse. If on a windows system the debugger can get
confused as to where files are if the path is not just right, like back
slashes mess it up, but I don't think that's eclipse.

Now that I'm using the new compiler, I would not recommend the old one.
I used the installer package and it knows where the headers are without
an environment setting.

You might want to check in on the mspgcc-users group.
m...@lists.sourceforge.net

I have not seen how much c++ I can get away with but in both versions
the double slash comments work. So, you should not have to 'fix' your
comments. The only difference I've seen with porting CCS code is the
interrupt naming convention. GCC has macro'd the 'interrupt( NAME )'
keyword in. I've ported the SimpliciTI
lib and that is a pile of
code. No 'code' changes were needed.

Get that version number. Consider just installing 4.4.3.

Best, Dan.

g4ndc wrote:
> G'day all,
>
> I'm currently working on a MSP430 project;
> Processor MSP430F2618
> Compiler CCS v4.1.3
>
> So far so good.
>
> However: I'm trying to change compilers to the GNU msp430 port.
> And I hit a number of problems.
>
> I've solved all the usual culls such as C++ comments etc
> and changed the header file thus:
>
> /*#define CCS */
> #define GNU
>
> #ifdef CCS
> /* this one for the CCS compiler */
> #include "msp430f2618.h"
> #else
> /* this one for GCC */
> #include "msp430x261x.h"
> #endif
>
> Now when I compile the include also includes at least the following.
> __msp430_headers_mpy_h
> __msp430_headers_gpio_h
>
> On entry to these files the compiler complains with this error mesage:-
>
> e:\mspgcc\msp430\include\msp430\mpy.h|18|syntax error before "asm"|
> e:\mspgcc\msp430\include\msp430\mpy.h|18|ISO C forbids data definition with no type or storage class|
>
> This pair of errors refer to the same line number [18] however there are repeats of this until the compiler gets too exasperated to print any more!
>
> So: What should I be doing that I haven't done ??
>
> Oh, and the compiler doen't appear to be able to embed any debug information.
>
> Comments / suggestions gratefully received.
>
> Del
>
>