Author Topic: MSP GCC not detected (Linux) (SOLVED)  (Read 12044 times)

Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
MSP GCC not detected (Linux) (SOLVED)
« on: January 14, 2017, 11:46:11 pm »
The problem is similar to  this topic.
I used C::B and MSP GCC for a couple of years. Recently I had to reinstall everything (PC crash).
First I snstalled MSP430-GCC-OPENSOURCE (SOMNIUM Technologies) v.4.2.0.36
Then I installed C::B 16.01. During the first launch the C::B detected msp-gcc toolchain and I selected it as a default Compiler.
But there was /usr path in Global compiler settings and I had to change it to ~/ti/msp430_gcc - look attachment. And I did it correctly (IMHO) because I coulde see the executables in a browse way. So I chose compilers and linkers from the bin directory.
But C::B says it cannot find compiler executable ... for GNU GCC Compiler for MSP430 (High Tech)

Why High Tech?
What does C::B search for if I set path to a Compiler in global settings?

« Last Edit: January 15, 2017, 10:56:24 pm by drvlas »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP GCC not detected (Linux)
« Reply #1 on: January 15, 2017, 01:48:58 am »
So you're saying that the executables work correctly if you run them from console/terminal?

Btw1: XXX-cpp is the preprocessor not the c++ compiler for this you have to use XXX-g++.
Btw2: Why are you editing GNU GCC instead of GNU GCC MPS430?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
Re: MSP GCC not detected (Linux)
« Reply #2 on: January 15, 2017, 09:49:32 am »
So you're saying that the executables work correctly if you run them from console/terminal?
Yes, Sir!
Attachment

Btw1: XXX-cpp is the preprocessor not the c++ compiler for this you have to use XXX-g++.
Sorry, I'm afraid I've not got you. Can you please point that 4 or 5 lines I have to fill right? Thank you!

Btw2: Why are you editing GNU GCC instead of GNU GCC MPS430?
That is a question. If I'd know what exactly I configure when I choose a Compiler from that droplist! I know that my Compiler is TI - Red Hat - SOMNIUM Technologies product. I see only High Tech option for msp430. What have I to choose? What depends on it?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP GCC not detected (Linux)
« Reply #3 on: January 15, 2017, 12:38:18 pm »
Can you paste the full build log where the error is printed?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
Re: MSP GCC not detected (Linux)
« Reply #4 on: January 15, 2017, 02:10:13 pm »
Here it is

Quote
"brd-01-13-v11 - Debug": The compiler's setup (GNU GCC Compiler for MSP430 (HighTec)) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?! (Do you have a compiler installed?)
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler for MSP430 (HighTec)->Toolchain executables" and fix the compiler's setup.
Skipping...
Nothing to be done (all items are up-to-date).


Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
Re: MSP GCC not detected (Linux)
« Reply #5 on: January 15, 2017, 03:55:25 pm »
This window is hard to catch:

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: MSP GCC not detected (Linux)
« Reply #6 on: January 15, 2017, 04:15:01 pm »
So the problem is that you're using the GNU GCC Compiler for MSP430 (HighTec) compiler, but you've setup the GNU GCC Compiler.
You have to options:
1. Either fix the setup of the compiler you're using. The log tells you exactly what to do!
2. Change your project to use the GNU GCC Compiler. This is done in the Project -> Build options.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
Re: MSP GCC not detected (Linux)
« Reply #7 on: January 15, 2017, 05:42:11 pm »
So the problem is that you're using the GNU GCC Compiler for MSP430 (HighTec) compiler
No, I'm not.
The only Compiler that has "MSP430" in its name is "GNU GCC Compiler for MSP430 (HighTec)". But I use the MSP430 Compiler of Red Hat (maintained by SOMNIUM Technologies). I've installed it, I tested it (and I use it for a some time), so it's the one in a world Compiler I need here.
What have I to do? I'm far from expert in IDEs. I don't understand what does C::B accept as a suitable compiler type for MSP430 chips.
I try the 1-st way:

1) Settings - Compiler - Global... - Selected compiler.
I select "GNU GCC Compiler for MSP430 (HighTec)"
I may or may not auto-detect the path, but anyway I leave in the :Compiler's installation directory" the right path to the directory where the Compiler's bin directory lies: /home/tkm/ti/msp430_gcc
2) As soon as I press OK I see that yellow warning.
3) Return to Settings - Compiler - Global... - Selected compiler. What do I see? GNU GCC Compiler.
So, C::B ignores my selection  "GNU GCC Compiler for MSP430 (HighTec)" if it cannot find Compiler.

Another way.
Let's try to use a plain  "GNU GCC Compiler".

0) Project - Build options... set  "GNU GCC Compiler"
1) Settings - Compiler - Global... - Selected compiler.
I select "GNU GCC Compiler" or rather leave it there as it's present always @ the entry.
Sure that "Compiler's installation directory": /home/tkm/ti/msp430_gcc
2) As soon as I press OK I see that yellow warning. The same warning about HighTec! Where is any word about the HighTec?

Cannot believe it's impossible. I may err, but it seems I used C::B 16.1 in my crashed PC. I sure I used Red Hat compiler. So the point is - I'm mistaken in my settings...


Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
Re: MSP GCC not detected (Linux)
« Reply #8 on: January 15, 2017, 06:27:00 pm »
it seems I used C::B 16.1 in my crashed PC. I sure I used Red Hat compiler.
N.B.! There's 2 (important?) points about the latter:

1) I used GCC from the TI Code Compose Studio package. The CCS gives options - to compile with the TI Compiler (up to 16KB code) or to use Red Hat Compiler. So the CCS package actually has the Red Hat Compiler. TI says it's the same as the standalone MSP430-GCC-OPENSOURCE (SOMNIUM Technologies) Compiler, but the directory structure is very different.
When I configured my C::B last time, I was the same dummy as I'm now. And I tried both packages - TI CCS package and stamdalone MSP430-GCC-OPENSOURCE package. And the latter was unsuccessful. I didn't ask this forum. I just used the TI CCS package GCC Compiler. Making a lot of stupid tries by the way... But it worked.

2) I can read the config files from my crashed PC and just copy all settings, copy TI CCS directory and use TI Compiler again.
But... I'd like to understand the C::B rules. So I ask oBFusCATed to help.

What should be in the directory that is marked "Compiler's installation directory"? Is it the "bin" where the compiler, linker and so on are?




Offline drvlas

  • Single posting newcomer
  • *
  • Posts: 9
SOLUTION
« Reply #9 on: January 15, 2017, 10:55:11 pm »
God bless text config files!

I've managed it somehow.
I decided that the best way to walk around (unknown for me) C::B procedures of configuration - to edit config files.
So I edited ~/.config/codeblocks/default.conf in a part of Compiler for MSP430:
Code
 			<msp430_gcc>
<NAME>
<str>
<![CDATA[MSP430-GCC-OPENSOURCE (SOMNIUM Technologies)]]>
</str>
</NAME>
<COMPILER_OPTIONS>
<str>
<![CDATA[-c -g -Os -Wall -ffunction-sections -fdata-sections;]]>
</str>
</COMPILER_OPTIONS>
<LINKER_OPTIONS>
<str>
<![CDATA[-Wl,-Map,${PROJECT_DIR}${TARGET_OUTPUT_FILE}.map;]]>
</str>
</LINKER_OPTIONS>
<INCLUDE_DIRS>
<str>
<![CDATA[/home/tkm/ti/msp430_gcc/include;/home/tkm/ti/msp430_gcc/msp430-elf/include;]]>
</str>
</INCLUDE_DIRS>
<LIBRARY_DIRS>
<str>
<![CDATA[/home/tkm/ti/msp430_gcc/include;]]>
</str>
</LIBRARY_DIRS>
<MASTER_PATH>
<str>
<![CDATA[/home/tkm/ti/msp430_gcc]]>
</str>
</MASTER_PATH>
<C_COMPILER>
<str>
<![CDATA[msp430-elf-gcc]]>
</str>
</C_COMPILER>
<CPP_COMPILER>
<str>
<![CDATA[msp430-elf-g++]]>
</str>
</CPP_COMPILER>
<LINKER>
<str>
<![CDATA[msp430-elf-g++]]>
</str>
</LINKER>
<LIB_LINKER>
<str>
<![CDATA[msp430-elf-ar]]>
</str>
</LIB_LINKER>
<DEBUGGER_CONFIG>
<str>
<![CDATA[gdb_debugger:Default]]>
</str>
</DEBUGGER_CONFIG>
</msp430_gcc>
...and made msp430_gcc a default Compiler

Maybe there are some minor errors or rather non-efficient code - it's not as important as the fact that the C::B accepted the changes.
Thanks to oBFusCATed for the hints! You made me to read a little - and I found a very useful way to set editor colors. In the previous life I used to create all colors manually. But now I've imported that beautiful file with themes and set my favorite dark one. The only thing that spoils the evening is: I cannot highlight the current line... Well, it's for tomorrow.