This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

msp430-elf-ld unable to find MCU file

Other Parts Discussed in Thread: MSP430F6638

Hello,

I am trying the msp430 gcc toolset for the first time, and having a simple linking problem:

msp430-elf-gcc -lmsp430f6638.ld main.o -o msp430f6638.out

gives the following error:

c:/ti/gcc/bin/../lib/gcc/msp430-elf/4.9.1/../../../../msp430-elf/bin/ld.exe: cannot find -lmsp430f6638.ld
collect2.exe: error: ld returned 1 exit status

The files main.o and msp430f6638.ld are in the current directory.  I copied everything to the current directory to make sure I'm not messing up LIB and INCLUDE paths in my Makefile.  I'm wondering if there's a naming convention that I'm unfamiliar with, similar to the .a automatically appended to filenames for libraries?

I'm developing using Windows 7, and have tried both the regular command line tool and MinGW (bash).  All environment variables are set to include the executable paths.

Thank you for any suggestions.

Adam

  • Adam Hoover said:
    msp430-elf-gcc -lmsp430f6638.ld main.o -o msp430f6638.out

    From looking at an example CCS project which uses the GCC compiler, the linker script should be given using the -T command line option, rather than the -l option (which is for library files).

    I.e. try:

    msp430-elf-gcc -Tmsp430f6638.ld main.o -o msp430f6638.out

  • Please see this post about the basics of invoking msp430-elf-gcc.  The compiler chooses the linker script for you based on the -mmcu option.  

    Thanks and regards,

    -George

  • Thank you.  There is a bug in TI's posted examples/windows/msp430generic/Makefile:

    LFLAGS = -L $(SUPPORT_FILE_DIRECTORY) -l $(DEVICE).ld

    This should be:

    LFLAGS = -L $(SUPPORT_FILE_DIRECTORY) -T $(DEVICE).ld

    Adam

  • Adam Hoover said:
    There is a bug in TI's posted examples/windows/msp430generic/Makefile

    Thank you for letting us know.  An issue has been filed with the team that supports that collection of support files.

    Thanks and regards,

    -George