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.

Linux and MSP430G2553; Linker issue: not able to create binary or elf file

Other Parts Discussed in Thread: MSP430G2553

Tool/software: Linux

Dear All,

I have a little problem. I tried ti find out what is the reason of the problem all over the google but I guess I don't have more option. So I have a Linux Debian 9 stretch. I just downloaded and installed an msp430-gcc packet what I downloaded from here. It is in the /home/myuser/Embedded/MSP/ dir. I wrote a Makefile, I mean I found and modified one. When I try to make I can make the blink.o file but I can not make binary or elf file. I just got this error message:

/Embedded/MSP/msp430-gcc/bin/../lib/gcc/msp430-elf/7.3.1/../../../../msp430-elf/bin/ld: cannot open linker script file msp
430g2553_symbols.ld:No file or directory

I am not perfect at linking but I guess it is not so hard if I give the correct path and filename in Makefile such as :

MCU = msp430g2553
INCLUDE_DIR = $$MSP_HOME/msp430-gcc/include

IFLAGS = -I $(INCLUDE_DIR)
#LFLAGS = -L $(INCLUDE_DIR) -T $(MCU).ld
GCC_DIR= /home/herczig/Embedded/MSP/msp430-gcc/bin/
LFLAGS = -L /usr/msp430/lib/ldscripts/msp430g2553 -T msp430g2553.ld
CC = $(GCC_DIR)msp430-elf-gcc
TARGET = -mmcu=$(MCU)
CFLAGS = -Wall -g -Os $(TARGET)

OBJS = blink.o


all: $(OBJS)
$(CC) $(CFLAGS) $(LFLAGS) $? -o $(MCU)

#blink: $(OBJS)
#$(CC) $(CFLAGS) -o blink.elf $(OBJS)
#$(LFLAGS) for blink

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

$$MSP_HOME is in the /etc/profile file.

I would be really glad and appreciate that if somebody could show me some idea or resolution! 

Best wishes, 

Adam

  • The linker script msp430g2553.ld probably contains these lines ...

    /****************************************************************************/
    /* Include peripherals memory map                                           */
    /****************************************************************************/
    
    INCLUDE msp430g2553_symbols.ld
    

    Do you have that file?  If so, make sure it is in the same directory as msp430g2553.ld.

    That said, I suggest you think about starting your project another way.

    Install Code Composer Studio.  It's free.  Start a new project.  Indicate which MSP430 device you use, and that you want to use the MSP430 GCC compiler.  With that information, CCS sets up the framework of the project for you, including the details you struggle with right now.

    Thanks and regards,

    -George

  • Dear George,

    Thanks for the fast reply! I have that symbols file in the same dir where there is the msp430.ld file. As I read other forums ( because a few months ago I downloaded the CCS), this version of  CCS on debian doesn't support msp430g2553 fet  to the flash. :(

  • Dear George,

    Your idea was a good point. I just looked for where are my .ld files and then successfully found the proper place.
    /usr/msp430/lib/ldscripts/msp430g2553/
    Here I just copied from the dir where the symbolins.ld is and after that I could compile and linking!
    Thanks again!