clinuxredhatmspgcc

TI's Red Hat mspgcc-430 compilation error


So, i'm trying to compile code, written in C for a msp430fx in a linux SO. I recently recompiled a new version of mspgcc, cause the previously used was 4.3 and it was not compatible/stable with extended mode (20 bits -mlarge).

I followed this site.

After installation i run a simple (main, call some random function) and it compiled well, but now, compiling this big project i have at the end this error:

msp430-gcc -o build/MoteISTv5_mspgcc/projects/common/03oos_macpong_prog -mmcu=msp430f5438a -Wall -Wno-main -mlarge -O0 -g -ggdb build/MoteISTv5_mspgcc/projects/common/03oos_macpong/03oos_macpong.o -Lbuild/MoteISTv5_mspgcc/bsp/boards -Lbuild/MoteISTv5_mspgcc/kernel/openos -Lbuild/MoteISTv5_mspgcc/drivers -Lbuild/MoteISTv5_mspgcc/openstack -Lbuild/MoteISTv5_mspgcc/openapps -lopenstack -lopenapps -lkernel -ldrivers -lbsp /opt/msp430-toolchain/lib/gcc/msp430-none-elf/4.9.1/../../../../msp430-none-elf/bin/ld: cannot open linker script file msp430f5438a.ld: No such file or directory collect2: error: ld returned 1 exit status scons: *** [build/MoteISTv5_mspgcc/projects/common/03oos_macpong_prog] Error 1 scons: building terminated because of errors.

Since i don't understand much about compilers, i need some help solving this issue. Can anybody help?

Thanx in advance,

Diogo Guerra


Solution

  • EDIT: In this new version of msp430-elf-gcc this function is named _read_SR() instead of __read_status_register().

    ======================= / ====================== / =====================

    Well, apparently i had to force the directory of the .ld file into the compiler flags with the -L .

    But now with the new msp430-gcc v4.9.1 he does not recognize the __read_status_register function, while in the mspgcc-legacy (4.6.3) he compiled without problems...

    I did some browsing and apparently the bin libraries do not support most of the __"spetial processor funcions". They said we had to use inline assembly to access special registers, which is awkward. "hy would they remove that support?

    If you need to use inline assembly here is an example for the __read_status_register()

    static inline __attribute__((always_inline))
    unsigned int __read_status_register( void){
        unsigned int xReturn;
        asm volatile( "MOV  R2, %0"
                    : "=r"  (xReturn)); // output parameters
        return xReturn;
    }
    

    To know more you can use this site that i found to be really usefull.