Quantcast

Linker help please

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Linker help please

Ian Chapman
Hi, I'm moving from to msp430g2553 from msp430f5438a and after some work
I have a clean compile.  However I'm getting this linker error.  Linking
and running are still okay with the previous chip.

msp430-gcc -o main.elf main.o uart.o ADC.o Timer.o Xref.o -Os -Wall -g
-mmcu=MSP430g2553
/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
Makefile:11: recipe for target 'main' failed
make: *** [main] Error 1

I have memory.x files for both chips in
/usr/msp430/lib/ldscripts/msp430f5438a/memory.x and in
/usr/msp430/lib/ldscripts/msp430g2553/memory.x.  I'm using DebianMint
2015 so I'm up to date there.  I've added the contents of the memory.x
files below.  I hope you can help me.  Regards Ian.
---------------------------------------------------------------------------
CC=msp430-gcc
CFLAGS=-Os -Wall -g -mmcu=MSP430g2553
#CFLAGS=-Os -Wall -g -mmcu=msp430f5438a
DEPS = main.h
OBJ = main.o  uart.o ADC.o Timer.o Xref.o

%.o: %.c $(DEPS)
     $(CC) -c -o $@ $< $(CFLAGS)

main: $(OBJ)
     $(CC) -o $@.elf $^ $(CFLAGS)
-------------------------------------------------------------------------
/usr/msp430/lib/ldscripts/msp430f5438a/memory.x
MEMORY {
   sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010,
size 16 */
   peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100,
size 240 */
   peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200,
size 256 */
   bsl              : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x1800,
size 2K as 4 512-byte segments */
   infomem          : ORIGIN = 0x1800, LENGTH = 0x0200 /* END=0x1a00,
size 512 as 4 128-byte segments */
   infod            : ORIGIN = 0x1800, LENGTH = 0x0080 /* END=0x1880,
size 128 */
   infoc            : ORIGIN = 0x1880, LENGTH = 0x0080 /* END=0x1900,
size 128 */
   infob            : ORIGIN = 0x1900, LENGTH = 0x0080 /* END=0x1980,
size 128 */
   infoa            : ORIGIN = 0x1980, LENGTH = 0x0080 /* END=0x1a00,
size 128 */
   ram (wx)         : ORIGIN = 0x1c00, LENGTH = 0x4000 /* END=0x5c00,
size 16K */
   rom (rx)         : ORIGIN = 0x5c00, LENGTH = 0xa380 /* END=0xff80,
size 41856 */
   vectors          : ORIGIN = 0xff80, LENGTH = 0x0080 /* END=0x10000,
size 128 as 64 2-byte segments */
   far_rom          : ORIGIN = 0x00010000, LENGTH = 0x00035c00 /*
END=0x00045c00, size 215K */
   /* Remaining banks are absent */
   ram2 (wx)        : ORIGIN = 0x0000, LENGTH = 0x0000
   ram_mirror (wx)  : ORIGIN = 0x0000, LENGTH = 0x0000
   usbram (wx)      : ORIGIN = 0x0000, LENGTH = 0x0000
}
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_FAR_ROM", far_rom);
PROVIDE (__info_segment_size = 0x80);
PROVIDE (__infod = 0x1800);
PROVIDE (__infoc = 0x1880);
PROVIDE (__infob = 0x1900);
PROVIDE (__infoa = 0x1980);
---------------------------------------------------------------------------------
/usr/msp430/lib/ldscripts/msp430g2553/memory.x
MEMORY {
   sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010,
size 16 */
   peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100,
size 240 */
   peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200,
size 256 */
   ram (wx)         : ORIGIN = 0x0200, LENGTH = 0x0200 /* END=0x0400,
size 512 */
   infomem          : ORIGIN = 0x1000, LENGTH = 0x0100 /* END=0x1100,
size 256 as 4 64-byte segments */
   infod            : ORIGIN = 0x1000, LENGTH = 0x0040 /* END=0x1040,
size 64 */
   infoc            : ORIGIN = 0x1040, LENGTH = 0x0040 /* END=0x1080,
size 64 */
   infob            : ORIGIN = 0x1080, LENGTH = 0x0040 /* END=0x10c0,
size 64 */
   infoa            : ORIGIN = 0x10c0, LENGTH = 0x0040 /* END=0x1100,
size 64 */
   rom (rx)         : ORIGIN = 0xc000, LENGTH = 0x3fe0 /* END=0xffe0,
size 16352 */
   vectors          : ORIGIN = 0xffe0, LENGTH = 0x0020 /* END=0x10000,
size 32 as 16 2-byte segments */
   /* Remaining banks are absent */
   bsl              : ORIGIN = 0x0000, LENGTH = 0x0000
   ram2 (wx)        : ORIGIN = 0x0000, LENGTH = 0x0000
   ram_mirror (wx)  : ORIGIN = 0x0000, LENGTH = 0x0000
   usbram (wx)      : ORIGIN = 0x0000, LENGTH = 0x0000
   far_rom          : ORIGIN = 0x00000000, LENGTH = 0x00000000
}
REGION_ALIAS("REGION_TEXT", rom);
REGION_ALIAS("REGION_DATA", ram);
REGION_ALIAS("REGION_FAR_ROM", far_rom);
PROVIDE (__info_segment_size = 0x40);
PROVIDE (__infod = 0x1000);
PROVIDE (__infoc = 0x1040);
PROVIDE (__infob = 0x1080);
PROVIDE (__infoa = 0x10c0);


------------------------------------------------------------------------------
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Linker help please

Peter Bigot-4
Try making the MCU name uniformly lowercase (msp430g2553).

On Sat, Aug 1, 2015 at 3:55 PM, Ian Chapman <[hidden email]> wrote:

> Hi, I'm moving from to msp430g2553 from msp430f5438a and after some work
> I have a clean compile.  However I'm getting this linker error.  Linking
> and running are still okay with the previous chip.
>
> msp430-gcc -o main.elf main.o uart.o ADC.o Timer.o Xref.o -Os -Wall -g
> -mmcu=MSP430g2553
> /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
> Makefile:11: recipe for target 'main' failed
> make: *** [main] Error 1
>
> I have memory.x files for both chips in
> /usr/msp430/lib/ldscripts/msp430f5438a/memory.x and in
> /usr/msp430/lib/ldscripts/msp430g2553/memory.x.  I'm using DebianMint
> 2015 so I'm up to date there.  I've added the contents of the memory.x
> files below.  I hope you can help me.  Regards Ian.
> ---------------------------------------------------------------------------
> CC=msp430-gcc
> CFLAGS=-Os -Wall -g -mmcu=MSP430g2553
> #CFLAGS=-Os -Wall -g -mmcu=msp430f5438a
> DEPS = main.h
> OBJ = main.o  uart.o ADC.o Timer.o Xref.o
>
> %.o: %.c $(DEPS)
>      $(CC) -c -o $@ $< $(CFLAGS)
>
> main: $(OBJ)
>      $(CC) -o $@.elf $^ $(CFLAGS)
> -------------------------------------------------------------------------
> /usr/msp430/lib/ldscripts/msp430f5438a/memory.x
> MEMORY {
>    sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010,
> size 16 */
>    peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100,
> size 240 */
>    peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200,
> size 256 */
>    bsl              : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x1800,
> size 2K as 4 512-byte segments */
>    infomem          : ORIGIN = 0x1800, LENGTH = 0x0200 /* END=0x1a00,
> size 512 as 4 128-byte segments */
>    infod            : ORIGIN = 0x1800, LENGTH = 0x0080 /* END=0x1880,
> size 128 */
>    infoc            : ORIGIN = 0x1880, LENGTH = 0x0080 /* END=0x1900,
> size 128 */
>    infob            : ORIGIN = 0x1900, LENGTH = 0x0080 /* END=0x1980,
> size 128 */
>    infoa            : ORIGIN = 0x1980, LENGTH = 0x0080 /* END=0x1a00,
> size 128 */
>    ram (wx)         : ORIGIN = 0x1c00, LENGTH = 0x4000 /* END=0x5c00,
> size 16K */
>    rom (rx)         : ORIGIN = 0x5c00, LENGTH = 0xa380 /* END=0xff80,
> size 41856 */
>    vectors          : ORIGIN = 0xff80, LENGTH = 0x0080 /* END=0x10000,
> size 128 as 64 2-byte segments */
>    far_rom          : ORIGIN = 0x00010000, LENGTH = 0x00035c00 /*
> END=0x00045c00, size 215K */
>    /* Remaining banks are absent */
>    ram2 (wx)        : ORIGIN = 0x0000, LENGTH = 0x0000
>    ram_mirror (wx)  : ORIGIN = 0x0000, LENGTH = 0x0000
>    usbram (wx)      : ORIGIN = 0x0000, LENGTH = 0x0000
> }
> REGION_ALIAS("REGION_TEXT", rom);
> REGION_ALIAS("REGION_DATA", ram);
> REGION_ALIAS("REGION_FAR_ROM", far_rom);
> PROVIDE (__info_segment_size = 0x80);
> PROVIDE (__infod = 0x1800);
> PROVIDE (__infoc = 0x1880);
> PROVIDE (__infob = 0x1900);
> PROVIDE (__infoa = 0x1980);
>
> ---------------------------------------------------------------------------------
> /usr/msp430/lib/ldscripts/msp430g2553/memory.x
> MEMORY {
>    sfr              : ORIGIN = 0x0000, LENGTH = 0x0010 /* END=0x0010,
> size 16 */
>    peripheral_8bit  : ORIGIN = 0x0010, LENGTH = 0x00f0 /* END=0x0100,
> size 240 */
>    peripheral_16bit : ORIGIN = 0x0100, LENGTH = 0x0100 /* END=0x0200,
> size 256 */
>    ram (wx)         : ORIGIN = 0x0200, LENGTH = 0x0200 /* END=0x0400,
> size 512 */
>    infomem          : ORIGIN = 0x1000, LENGTH = 0x0100 /* END=0x1100,
> size 256 as 4 64-byte segments */
>    infod            : ORIGIN = 0x1000, LENGTH = 0x0040 /* END=0x1040,
> size 64 */
>    infoc            : ORIGIN = 0x1040, LENGTH = 0x0040 /* END=0x1080,
> size 64 */
>    infob            : ORIGIN = 0x1080, LENGTH = 0x0040 /* END=0x10c0,
> size 64 */
>    infoa            : ORIGIN = 0x10c0, LENGTH = 0x0040 /* END=0x1100,
> size 64 */
>    rom (rx)         : ORIGIN = 0xc000, LENGTH = 0x3fe0 /* END=0xffe0,
> size 16352 */
>    vectors          : ORIGIN = 0xffe0, LENGTH = 0x0020 /* END=0x10000,
> size 32 as 16 2-byte segments */
>    /* Remaining banks are absent */
>    bsl              : ORIGIN = 0x0000, LENGTH = 0x0000
>    ram2 (wx)        : ORIGIN = 0x0000, LENGTH = 0x0000
>    ram_mirror (wx)  : ORIGIN = 0x0000, LENGTH = 0x0000
>    usbram (wx)      : ORIGIN = 0x0000, LENGTH = 0x0000
>    far_rom          : ORIGIN = 0x00000000, LENGTH = 0x00000000
> }
> REGION_ALIAS("REGION_TEXT", rom);
> REGION_ALIAS("REGION_DATA", ram);
> REGION_ALIAS("REGION_FAR_ROM", far_rom);
> PROVIDE (__info_segment_size = 0x40);
> PROVIDE (__infod = 0x1000);
> PROVIDE (__infoc = 0x1040);
> PROVIDE (__infob = 0x1080);
> PROVIDE (__infoa = 0x10c0);
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>

------------------------------------------------------------------------------

_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Loading...