Author Topic: MSP430 compiler did not listed  (Read 16319 times)

Offline martonmiklos

  • Single posting newcomer
  • *
  • Posts: 7
MSP430 compiler did not listed
« on: April 01, 2011, 09:04:52 pm »
Hello all,

I would like to use the C::B for MSP430 development using mspgcc4.
I have managed to compile the toolchain to the /op/mspgcc4 folder.
I have selected Settings -> Compiler and Debugger Settings, but the MSP430 GCC is not listed there.

I am using C::B 10.05 from ppa:
http://forums.codeblocks.org/index.php?topic=13203.0

I have linked all the mspgcc binares to the /usr/bin, but it did no helped.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: MSP430 compiler did not listed
« Reply #1 on: April 01, 2011, 09:23:38 pm »
Copy the GCC compiler and change the executables in the Toolchain tab
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: MSP430 compiler did not listed
« Reply #2 on: April 01, 2011, 09:24:50 pm »
I have selected Settings -> Compiler and Debugger Settings, but the MSP430 GCC is not listed there.
What do you mean by that? It's not enough to compile a(ny) compiler and C::B will automatically support it. How should that work? :shock:

However, if your target compiler is interface compatible with GCC (which seems the case) you can easily make a copy of the GCC compiler and adjust the settings, primary the compiler/linker... executables accordingly.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline martonmiklos

  • Single posting newcomer
  • *
  • Posts: 7
Re: MSP430 compiler did not listed
« Reply #3 on: April 01, 2011, 09:43:24 pm »
The wiki page says that this compiler is supported:
http://wiki.codeblocks.org/index.php?title=Main_Page

This page said that this compiler should be listed too:
http://cubesat.wikidot.com/obdh-codeblocks-guide

I have a few compilers in the list (PowerPC gcc for e.g.) which I do not have installed, so I do not think that the C::B lists only the detected compilers there.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: MSP430 compiler did not listed
« Reply #4 on: April 01, 2011, 10:22:21 pm »
The wiki page says that this compiler is supported:
http://wiki.codeblocks.org/index.php?title=Main_Page
If you read further you'll realise that this is Windows only. ;-) It's untested on Linux.

You can (however) try to compile c::B yourself and see if it's working on Linux, too.
« Last Edit: April 01, 2011, 10:25:52 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline martonmiklos

  • Single posting newcomer
  • *
  • Posts: 7
Re: MSP430 compiler did not listed
« Reply #5 on: April 01, 2011, 10:35:38 pm »
@MortenMacFly
Oh yes, it is a bit late at us now, so I have missed it.

Copying the GCC compiler template, and correcting the executables path does not working, because the mspgcc has several compiler specific option just like the -mmcu option for e.g.

I have checked out the latest code, and found the related code in the compilerGNUMSP430.cpp. As I seen it is not windows only, and it is looking for the executables in the /usr/local/msp430. I have linked the neccessary content to there.
I have analyzed the code further and realized that this compiler is not enabled on Linux.
So I will hack it tomorrow.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: MSP430 compiler did not listed
« Reply #6 on: April 01, 2011, 10:41:23 pm »
So I will hack it tomorrow.
I had a look into, it's actually quite simple:
Just move the inclusion of:
Code: [Select]
   #include "compilerGNUMSP430.h"
out of the "#ifdef __WXMSW__" section and this should probably be it.

If it works, please report back and we can do it on trunk.

(I am using Linux only if needed you know...)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline martonmiklos

  • Single posting newcomer
  • *
  • Posts: 7
Re: MSP430 compiler did not listed
« Reply #7 on: April 01, 2011, 11:20:50 pm »
I have done with it, and compiling a sample project is working.

I have some plans:
- The supported MCU's list needs some extending. It will be easy, because I have found all the possible -mmcu options int the mspgcc's source so after some regexp playing I will add them easily.
- I will improve the default compiler path looking algorithm, because most the mspgcc4's offical installer installs itself to the /opt by default.
- I will try to hack a project wizard, whith what I could add "inhouse" programming feature using mspdebug as post build or run step.

If I will be ready I will submit my work as a patch.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: MSP430 compiler did not listed
« Reply #8 on: April 02, 2011, 09:19:17 am »
If I will be ready I will submit my work as a patch.
Great. Thank you.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline martonmiklos

  • Single posting newcomer
  • *
  • Posts: 7
Re: MSP430 compiler did not listed
« Reply #9 on: April 05, 2011, 10:47:43 pm »
I know this is not the most suitable topic to ask it, but maybe you have some idea how should I implement it:
I would like to have an associative array in the wizard script, because the mspdebug needs the MCU name in different format than the msp-gcc.
I figured out that the script is written in squirrel, but the documentation of it is very poor. According to it in the 3.0 version docs it says I can create tables in JSON format, but when using this syntax it gives me an error message at the first point. The 2.0 doc's table section is completly unundestoodable by me. The C::B docs does not says anything about the squuirrel version, but I guess it uses the 2.0 syntax

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: MSP430 compiler did not listed
« Reply #10 on: April 05, 2011, 11:01:07 pm »
Squirrel is 2.2.something... 3.0 seems pretty new...
(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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: MSP430 compiler did not listed
« Reply #11 on: April 06, 2011, 06:40:09 am »
Squirrel is 2.2.something... 3.0 seems pretty new...
Squirrel 2.2.4 and SqPlus (for that version).
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

VaZso

  • Guest
Re: MSP430 compiler did not listed
« Reply #12 on: May 02, 2011, 02:35:21 am »
Hello,

I've tried to setup CodeBlocks to work with MSP430 under Linux.
I have the compiler in /opt directory and I could modify the settings based on "GNU AVR GCC Compiler"
with the appropriate paths... the only thing I couldn't find is how to add/modify compiler flags.

So I would like to set the -mmcu flag, but now I can't find where can I do this.

I hope you can help me find this out.

Sorry if my question is too simple, I'm a bit tired because it is too late here now.

Thank you for any help.

Edit: Is it a solution, if I write the appropriate switch(es) under "other options" tab at compiler & debugger settings?
May it work well?
« Last Edit: May 02, 2011, 09:49:48 am by VaZso »

Offline doragasu

  • Single posting newcomer
  • *
  • Posts: 7
Re: MSP430 compiler did not listed
« Reply #13 on: September 12, 2011, 04:12:55 pm »
Hi,

Any news about this topic? Is there a way to use C::B for mspgcc under Linux?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: MSP430 compiler did not listed
« Reply #14 on: September 12, 2011, 04:29:37 pm »
I have done with it, and compiling a sample project is working.

I have some plans:
- The supported MCU's list needs some extending. It will be easy, because I have found all the possible -mmcu options int the mspgcc's source so after some regexp playing I will add them easily.
- I will improve the default compiler path looking algorithm, because most the mspgcc4's offical installer installs itself to the /opt by default.
- I will try to hack a project wizard, whith what I could add "inhouse" programming feature using mspdebug as post build or run step.

If I will be ready I will submit my work as a patch.
Have you read this?
Then reread the topic, download the c::b's code, modify it accordingly and then compile it...
(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!]