Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Eclipse MSP430-gcc integration

$
0
0

I have followed the tutorial on this site for integrating Eclipse with msp430-gcc.

 

I am running ubuntu 13.04 64 bit. msp430-gcc (GCC) 4.6.3 20120301 (mspgcc LTS 20120406 unpatched)

 
Eclipse Platform Version: 3.8.1
 
Compiling manually on a Terminal works:
 
I have a simple programme to toggle LED on the MSP430 Launchpad Rev 1.5 board.
 
I compile this on a terminal using 
 
msp430-gcc -mmcu=msp-430g2553 -o led.elf blinkingled.c 
 
This gets compiled and I can flash the binary to my board and it works.
 
When I have this same setup to compile on Eclipse the compilation is in two stages. The first step is creating object files and then the linker kicks in. 
 
I have included the following Library search path under GCC C Linker --> Libraries in Eclipse
/usr/msp430/lib
 
This is as per the tutorial, however this results in 
 
Building target: led.elf
Invoking: GCC C Linker
msp430-gcc --mmcu=msp430g2553 -Wl,-Map=led.map -L/usr/msp430/lib/ -o "led.elf"  ./led.o   
/usr/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
make: *** [led.elf] Error 1
 
For the linker to succeed, as a work around I have given the full path in GCC C Linker --> Libraries in Eclipse
 
/usr/msp430/lib/ldscripts/msp430g2553
 
With this linking succeeds and am able to create the led.elf using eclipse.
 
Can some one throw a light on what is wrong with my setup which is preventing the linker to fail in the first setup?

 

 

Problem 2

 

I have File1.c, File2.c and File2.h all in the same folder.

 

I am calling a function func1 inside File1.c. File1.c has File2.h in its #include.

 

func1 is defined in File2.h and implemented in File2.c

 

I am able to compile this using the following command on a terminal

 

msp430-gcc -mmcu=msp430g2553 -I/usr/msp430/include -I/usr/include -I"./" File2.c File1.c -o something.elf
 
this compiles and I am able to flash the firmware on to the board.
 
When I try to compile the same set of code inside Eclipse
 
I get 
 
File2. c gets compiled to File2.0
 
File1.c compilation fails.
 
File1.c (.init9+0xc): undefined reference to `func1'
 
 
Again this is some configuration in Eclipse which is not set properly which is preventing it to relate to the object files.
 
Could some one kindly throw some light .
 
With regards
Krishna
 
 

Viewing all articles
Browse latest Browse all 2077

Trending Articles