You'll want to specify the processor when compiling and linking.

msp430-gcc -mmcu=xxx main.o -o main.elf

replace xxx with the processor that you are using like msp430f149

 There are linker scripts to tell ld (invoked by gcc) how to link and where the 
vector table goes, where rom starts, rom starts, etc.

adam
-----Original Message-----
From: Ian Chapman [mailto:ichap...@videotron.ca]
Sent: Thursday, October 04, 2012 1:42 PM
To: mspgcc-users@lists.sourceforge.net
Subject: [Mspgcc-users] Linking problem

I'm using the PCB from TI with the msp4302211 packaged in a 14 pin DIP.
My msp430-gcc --version from Mint13 is
msp430-gcc (GNU GCC patched mspgcc-20110716) 4.5.3 I have made a small "c" 
program to get into the swing of it and that loaded into 0xf800 with mspdebug 
ran the way I expected.

Trying the same thing with assembly code was and is quite frustrating.
The part has 2K of flash and I guess it's 0xf800 to 0xffff.
     .org    0xf800    ;gives assembly errors.
msp430-as -Wall -mP  main.s -o main.o
main.s: Assembler messages:
main.s:47: Error: operand out of range: -63126
main.s:48: Error: operand out of range: -41834
main.s:48: Error: operand out of range: -63130 Junking the org directive but 
keeping the
     .org    0ffe0    ;For my interrupt vectors
The assembly was clean creating a main.o and a listing.

Linking with      msp430-gcc main.o -o main.elf
/usr/lib/gcc/msp430/4.5.3/../../../../msp430/bin/ld: main.elf section `.text' 
will not fit in region `rom'
But no main.elf !!!  If I junk my interrupt vectors oxffe0 then assemble and 
link I get a main.elf.
Using mspdebug I can prog it and it went into 0xfc00 (NOT 0xf800 as
expected) with a bit of stuff that's not mine up front.  Of course I'm not able 
to run it as I do not have any interrupt vectors.  Any pointers greatly 
appreciated.  I've played with .fartext to no avail.  Ian.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM Deploy 
New Relic app performance management and know exactly what is happening inside 
your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and 
get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

This email, including any attachments and files transmitted with it, are for 
the sole use of the intended recipient(s) to whom this email is addressed, and 
may contain confidential and/or privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please be advised that you have received this email in 
error, and please contact the sender by reply email and destroy all copies 
(including all electronic and hard copies) of the original message. Thank you.

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to