I have the same problem, when using msp430-gdb to debug files compiled
for the msp430x449.

It looks like for msp430x44x devices the linker creates a bit different
elf files than for other devices.

The elf files seem to be ok, because other programs than msp430-gdb can
handle the elfs (e.g. "msp430-downloader" or "Noice for MSP430" ).

But when trying to load the ELF in msp430-gdb, the error
"XXX.elf" is not an object file: File format not recognized
is coming up.

Digging deeper showed, that the compilation of a simple main.c will
trigger the following commands.

C-Compiler
E:\mspgcc\lib\gcc-lib\msp430\3.2.3\cc1.exe -lang-c -v -I. -iprefix
E:\mspgcc\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_SIZE__ -D__OPTIMIZE__ -D__STDC_HOSTED__=1
-DMSP430_HAS_HW_MUL -D__MSP430_449__ -DMSP430_HAS_HWMUL
-D__SIZE_TYPE__=unsigned int -D__PTRDIFF_TYPE__=int -D__INT_MAX__=32767
main.c -quiet -dumpbase main.c -mmcu=msp430x449 -g -Os -Wall -version

Assembler
E:\mspgcc\msp430\bin\as.exe --traditional-format -mmcu=msp430x449 -o
main.o main.s

Linker
E:\mspgcc\msp430\bin\ld.exe -m msp430x449 -o LED_Blink.elf
E:\mspgcc\msp430\lib\crt430x449.o -LE:\mspgcc\lib\gcc-lib\msp430\3.2.3
-LE:\mspgcc\lib\gcc-lib -LE:\mspgcc\msp430\lib -LE:\mspgcc\lib main.o
-lgcc -lc -lgcc

When changing the *linker *command from
E:\mspgcc\msp430\bin\ld.exe -m msp430x4*49* -o LED_Blink.elf
E:\mspgcc\msp430\lib\crt430x449.o -LE:\mspgcc\lib\gcc-lib\msp430\3.2.3
-LE:\mspgcc\lib\gcc-lib -LE:\mspgcc\msp430\lib -LE:\mspgcc\lib main.o
-lgcc -lc -lgcc
to
E:\mspgcc\msp430\bin\ld.exe -m msp430x4*37* -o LED_Blink.elf
E:\mspgcc\msp430\lib\crt430x449.o -LE:\mspgcc\lib\gcc-lib\msp430\3.2.3
-LE:\mspgcc\lib\gcc-lib -LE:\mspgcc\msp430\lib -LE:\mspgcc\lib main.o
-lgcc -lc -lgcc

The produced ELF is working fine with msp430-gdb.
So it looks like ld.exe produces different ELF output for 44x devices
than for other devices.

So it looks like, that the problem can be solved by
 - changing ld.exe to produce other ELFs for 44x devices, or by
 - changing msp430-gdb to handle the ELF files produced by ld for 44x
devices the right way, like other debuggers and loaders do.

I hope, some of the developers will fix this bu iin MSP430-gdb, so
developement with Eclips and mspgcc can work as fine with 44x devices as
with the other msp devices.

Greetings

Matthias Hartmann

I used mspgcc snapshot mspgcc-20081230 on windows XP SP3

Reply via email to