Tool/software:
I want to use C++17 for my project, so I have added the MSP430-gcc compiler in CCS Theia. I created a new project using "msp430fr599x_1.c Blink LED" example with the default compiler (TI v21.6.1.LTS), and the project built without any errors.
However, when I changed the compiler to GNU v9.3.1.11 (from Mitto System Limited), I encountered build errors. Can anyone help me understand these linker errors? I am using CCS Theia v 20.1.1
[2]Building target: "msp430fr599x_1.c.out"
[3]Invoking: GNU Linker
[4]"C:/ti/msp430-gcc/bin/msp430-elf-gcc-9.3.1.exe" -mhwmult=f5series -Og -g -gdwarf-3 -gstrict-dwarf -Wall -mcode-region=none -mlarge -Wl,-Map,"msp430fr599x_1.c.map" -Wl,--gc-sections -L"C:/ti/ccs2011/ccs/ccs_base/msp430/include_gcc" -mmcu=msp430fr5994 -o"msp430fr599x_1.c.out" "./msp430fr599x_1.o" -T"../lnk_msp430fr5994.cmd" -Wl,--start-group -lgcc -lc -Wl,--end-group
[5]makefile:138: recipe for target 'msp430fr599x_1.c.out' failed
[6]c:/ti/msp430-gcc/bin/../lib/gcc/msp430-elf/9.3.1/../../../../msp430-elf/bin/ld.exe:../lnk_msp430fr5994.cmd:59: syntax error
[7]collect2.exe: error: ld returned 1 exit status
[8]gmake[1]: *** [msp430fr599x_1.c.out] Error 1
[9]makefile:134: recipe for target 'all' failed
[10]gmake: *** [all] Error 2
What do you see at line 59 of lnk_msp430fr5994.cmd [in your project]?
In mine (CCS v12.6) line 59 says:
TINYRAM : origin = 0xA, length = 0x16
I don't see any obvious syntax error here, but the linker can be finicky.
GCC, at least in the Linux version for the MSP430, uses linker scripts with the suffix ".ld". They are different from the .cmd version.
MEMORY { TINYRAM : ORIGIN = 0x000A, LENGTH = 0x0016 /* END=0x001F, size 22 */ BSL : ORIGIN = 0x1000, LENGTH = 0x0800 /* END=0x17FF, size 2048 */
The man page for ld doesn't say anything about case sensitivity:
" The ORIGIN is an numerical expression for the start address of the
memory region. The expression must evaluate to a constant and it cannot
involve any symbols. The keyword ‘ORIGIN’ may be abbreviated to ‘org’
or ‘o’ (but not, for example, ‘ORG’)."
Editing the linker script to make those keywords lower case resulted in a syntax error. So the fault is with not using the GCC specific linker scripts.
Hi Bruce, thank you for your response. In mine (CCS v20.1.1) line 59 also says same:
TINYRAM : origin = 0xA, length = 0x16
I created an empty project with CCS v12.7.0 using GNU v9.3.1.11. It generates a GCC-specific linker script (".ld") as David mentioned, instead of the default ".cmd" file, and compiles without errors.
The issue arises with Theia. In Theia, I can only create new projects from provided examples, which are set up with the default TI compiler. I cannot change the compiler to GCC directly. The project is created with a ".cmd" file, and when I switch to the GCC compiler afterward, I encounter the build error mentioned earlier.
When I import a project from CCS v12.7.0 with the ".ld" linker script into Theia, the project is not recognized and does not work. Is there any way to create an empty project with MSP430FR5994 using GCC compiler in CCS Theia?
**Attention** This is a public forum