|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
cannot compile __bic_SR_register_on_exit( ) from mspgcc v.3.2.3Hello,
I cannot compile __bic_SR_register_on_exit() using mspgcc version 3.2.3: My source file: #include <iomacros.h> #define USCI_A0_VECTOR 114 #define OSCOFF (1<<5) extern "C" interrupt( USCI_A0_VECTOR) isr_func(void) { __bic_SR_register_on_exit( OSCOFF ); } It is probably caused by not allowed trial of merging __FUNCTION__ with other string in macro that defines __bic_SR_register (in iomacros.h): #define __bic_SR_register_on_exit(x) \ __asm__ __volatile__ ( \ "bic %0, .L__FrameOffset_" __FUNCTION__ "(r1)" \ : : "ir" ((uint16_t) x) \ ) Is it __FUNCTION__ a literal or "const char *" ? Other information: 1. host operating system: Windows XP 2. prebuild installer: mspgcc-20081230.exe 3. mcu = msp430f5438 4. source compiled by following line: msp430-gcc -c -v -mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshad ow -Wstrict-prototypes -Wswitch -Wunused -I. -Ie:/mspgcc/msp430/include -fno-exceptions -fno-rtti -Wa,-adhlns=bic_bug.c bic_bug.c -o bic_bug.o Reading specs from e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\specs Configured with: ./configure --target=msp430 --prefix=c:/work/mspgcc/sf/packaging/build/installed --disable-multilib --disable-libc --disable-libssp --disable-intl --disable-libiberty --with-gcc --wit h-gnu-ld --with-gnu-as --with-stabs --disable-shared --disable-threads --disable-win32-registry --disable-nls --enable-languages=c,c++ Thread model: single gcc version 3.2.3 e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\cc1.exe -lang-c -v -I. -Ie:/mspgcc/msp430/include -iprefix e:\mspgcc\bin\..\lib/gcc-lib/msp430\3.2.3\ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102 -DMSP430 -D__MSP430__ -D__MSP430 -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -DMSP430_HAS_HW_MUL -D__MSP430_5438__ -D__MSP430X2__ -DMSP430_HAS_HWMUL -D__SIZE_TYPE__=unsigned int -D__PT RDIFF_TYPE__=int -D__INT_MAX__=32767 bic_bug.c -quiet -dumpbase bic_bug.c -mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-extern s -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused -version -fno-exceptions -fno-rtti -o C:\DOCUME~1\internet\LOCALS~1\Temp/ccRCHztf.s GNU CPP version 3.2.3 (cpplib) (GNU assembler syntax) GNU C version 3.2.3 (msp430) compiled by GNU C version 3.4.5 (mingw-vista special r3). ignoring nonexistent directory "e:/mspgcc/msp430/sys-include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/includ e" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../ ../../msp430/sys-include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../ ../../msp430/include" #include "..." search starts here: #include <...> search starts here: . e:/mspgcc/msp430/include e:/mspgcc/lib/gcc-lib/msp430/3.2.3/include e:/mspgcc/msp430/include End of search list. bic_bug.c:7: syntax error before string constant make: *** [bic_bug.o] Error 1 5. running preprocessor: msp430-gcc -E -v -mmcu=msp430x5438 -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshad ow -Wstrict-prototypes -Wswitch -Wunused -I. -Ie:/mspgcc/msp430/include -fno-exceptions -fno-rtti -Wa,-adhlns=bic_bug.c bic_bug.c -o bic_bug.i Reading specs from e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\specs Configured with: ./configure --target=msp430 --prefix=c:/work/mspgcc/sf/packaging/build/installed --disable-multilib --disable-libc --disable-libssp --disable-intl --disable-libiberty --with-gcc --wit h-gnu-ld --with-gnu-as --with-stabs --disable-shared --disable-threads --disable-win32-registry --disable-nls --enable-languages=c,c++ Thread model: single gcc version 3.2.3 e:\mspgcc\bin\..\lib\gcc-lib\msp430\3.2.3\cpp0.exe -lang-c -v -I. -Ie:/mspgcc/msp430/include -iprefix e:\mspgcc\bin\..\lib/gcc-lib/msp430\3.2.3\ -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__= 3 -D__GXX_ABI_VERSION=102 -DMSP430 -D__MSP430__ -D__MSP430 -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -DMSP430_HAS_HW_MUL -D__MSP430_5438__ -D__MSP430X2__ -DMSP430_HAS_HWMUL -D__SIZE_TYPE__=unsigned int -D__P TRDIFF_TYPE__=int -D__INT_MAX__=32767 bic_bug.c -o bic_bug.i -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -W return-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused GNU CPP version 3.2.3 (cpplib) (GNU assembler syntax) ignoring nonexistent directory "e:/mspgcc/msp430/sys-include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/includ e" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../ ../../msp430/sys-include" ignoring nonexistent directory "c:/work/mspgcc/sf/packaging/build/installed/lib/gcc-lib/msp430/3.2.3/../../ ../../msp430/include" #include "..." search starts here: #include <...> search starts here: . e:/mspgcc/msp430/include e:/mspgcc/lib/gcc-lib/msp430/3.2.3/include e:/mspgcc/msp430/include End of search list. 6. Preprocesor output: # 1 "bic_bug.c" # 1 "<built-in>" # 1 "<command line>" # 1 "bic_bug.c" # 1 "e:/mspgcc/msp430/include/iomacros.h" 1 # 34 "e:/mspgcc/msp430/include/iomacros.h" # 1 "e:/mspgcc/msp430/include/sys/inttypes.h" 1 # 38 "e:/mspgcc/msp430/include/sys/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef int16_t intptr_t; typedef uint16_t uintptr_t; # 35 "e:/mspgcc/msp430/include/iomacros.h" 2 # 2 "bic_bug.c" 2 extern "C" interrupt( 114) isr_func(void) { __asm__ __volatile__ ( "bic %0, .L__FrameOffset_" __FUNCTION__ "(r1)" : : "ir" ((uint16_t) (1<<5)) ); } PS Please excuse me, previous post was sent in HTML from Outlook, and has been truncated. #include <iomacros.h> #define USCI_A0_VECTOR 114 #define OSCOFF (1<<5) extern "C" interrupt( USCI_A0_VECTOR) isr_func(void) { __bic_SR_register_on_exit( OSCOFF ); } # 1 "bic_bug.c" # 1 "<built-in>" # 1 "<command line>" # 1 "bic_bug.c" # 1 "e:/mspgcc/msp430/include/iomacros.h" 1 # 34 "e:/mspgcc/msp430/include/iomacros.h" # 1 "e:/mspgcc/msp430/include/sys/inttypes.h" 1 # 38 "e:/mspgcc/msp430/include/sys/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef int16_t intptr_t; typedef uint16_t uintptr_t; # 35 "e:/mspgcc/msp430/include/iomacros.h" 2 # 2 "bic_bug.c" 2 extern "C" interrupt( 114) isr_func(void) { __asm__ __volatile__ ( "bic %0, .L__FrameOffset_" __func__ "(r1)" : : "ir" ((uint16_t) (1<<5)) ); } ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Mspgcc-users mailing list Mspgcc-users@... https://lists.sourceforge.net/lists/listinfo/mspgcc-users |
|
|
|
|
|
|
|
|
Re: cannot compile __bic_SR_register_on_exit( ) from mspgcc v.3.2.3I compiled the code for msp430f5438, hence the vector equal to 114 (it is
located at 0xFFF2). The C program can be compiled when I removed unnecessary "extern C" - thank you Przemek for suggestion. I also experimented with C++ but there is a problem with __FUNCTION__ (or __func__). In C++ they are not a string literals but "const char *", so it cannot be concatenated with other literals. Please try to compile with GCC the .cpp file containing following code: int main( int argc, char *argv[] ) { char *txt = __FUNCTION__ "something"; const char *txt = __FUNCTION__ "something"; } My intention was to use ISR routine in .cpp file, I need there an access to classes and need to use _bic_SR.... I saw that "extern C" simplifies function names in listing, so the names are compatible with __FUNCTION__, but mentioned above problem with concatenation remains. Piotr Romaniuk -----Original Message----- From: JMGross [mailto:mspgcc@...] Sent: Monday, September 28, 2009 6:13 PM To: MSPGCC mailing list, Subject: Re: [Mspgcc-users] cannot compile __bic_SR_register_on_exit( ) from mspgcc v.3.2.3 The valid vectors are all below 0x10000, so 0x10052 does not point into the vector table. This is most likely caused by a wrong start value for the vectors. Unfortunately, all vectors are defined up from a defined start address instead of down from 0xfffe. So the start address differs with the number of vectors. And I remember a wrong start address being discovered in one of the header files several months ago (together with a patch posted here in the list and merged into CVS). Anyway, a second look into the source file shows USCI_A0_VECTOR being defined in the very same file as 114 (which is 0x72). Give the default start address of 0xffe0 for the vector tables in older devices, this becomes 0x10052 which is outside the vector segment. For the newer devices (with more interrupt siources) the start address for vectors is 0xff80. With this, the given vector offset will result in the proper address of 0xfff2. So most likely the makefile is wrong (stating the wrong target device) or the linker script has a wrong segment definition table. JMGross ----- Ursprüngliche Nachricht ----- Von: Przemek Klosowski An: GCC for MSP430 - http://mspgcc.sf.net Gesendet am: 27 Sep 2009 15:47:13 Betreff: Re: [Mspgcc-users] cannot compile __bic_SR_register_on_exit( ) from mspgcc v.3.2.3 Per Steve Underwood's MSPGCC manual, you have to #include <signal.h> in the interrupt service code modules (1) . Also, extern "C" is not necessary for compiling C, and I believe is not even alowed in C code: it prevents mangling of C++ externals so it's only needed for C++ code (i.e. .cpp/.C/.cxx files). With those two changes, your code compiles. with warnings about __FUNCTION__ being deprecated, and an invalid Interrupt vector being assigned to your ISR. I understand that the current GCC replaces __FUNCTION__ with __func__ so the iomacros.h file should be patched accordingly. I am not sure about the ISR vector number: the warning is about vector 0x10052 which isn't even mentioned in the file. Perhaps someone familiar with writing ISRs for MSPGCC can explain what's going on. ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Mspgcc-users mailing list Mspgcc-users@... https://lists.sourceforge.net/lists/listinfo/mspgcc-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ Mspgcc-users mailing list Mspgcc-users@... https://lists.sourceforge.net/lists/listinfo/mspgcc-users |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |