Jump to content
xpg

Eclipse plugin for mspdebug and msp430-gcc

Recommended Posts

While you're at it, could you add command line options for mspdebug like '-j'. :wave:

 

I'm currently working on that. Should have a release ready soon. Unfortunately, another project is taken more time that I had anticipated, so that's why I didn't get it out yet. But it will be there soon, I promise :-)

 

/P

Share this post


Link to post
Share on other sites
@xpg I used your instructions at http://www.43oh.com/forum/viewtopic.php?f=5&p=13656#p13656. The install worked fine by deselecting the toolchains. The next step of opening 'window -> preferences' is where the issue lies -there is no MSP430 tab. Looking at your screenshot, I assumed that if the install of the plugin worked, I could manually locate my mspgcc installs.

 

That doesn't sound good, at all. I will try to see if I can reproduce on a BSD system soon.

Share this post


Link to post
Share on other sites
Please don't beat me, but will this work for windows as well?

 

I normally use CCS, but having an opensource alternative and using the mspgcc would be preferable. A easy to setup 100% opensource IDE for linux, windows and macos would be a big step into the right direction.

At this point this is a Linux only thing (probably won't work on any BSDs either), but if there is interest for it, I'm willing to try to make it work on Windows as well.

 

@xpg:

 

You could count me for the Windows version, too.

Maybe there are more users out there ?

 

Cheers,

Thomas

Share this post


Link to post
Share on other sites

You could count me for the Windows version, too.

Maybe there are more users out there ?

 

Well, if there are two users there are probably more :-). I'll look into it. However, I think I'll have to change the way I bundle the binary toolchains first. Currently, they are installed as eclipse packages (features), but it does not seem that Eclipse is made for distributing binary executables. I'm going to create a small binary toolchain manager, which needs to be run after the msp430 plugin is installed. It is then responsible for downloading the toolchain and extracting it to a user specified directory. This also solves the issues that the plugin currently has with distribution provided Eclipse-versions.

Share this post


Link to post
Share on other sites

This plugin looks like it could be really useful. I've set it up as per the video, but on my system there are a couple of problems:

 

- If I use #include to include the cpu-specific register defs, the compiler doesn't find the symbols. This is cured by using '#include ', but I don't want to do this long term because the project I'm working on uses io.h and it's not all my code. The compiler flag is set in the project properties - the full options are '-I/opt/msp430tools/msp430/include -I/opt/msp430tools/include -O0 -g -Wall -mmcu=msp430f2274 -std=gnu89'

- the debugger isn't starting. I'm using a recently compiled mspdebug, which I've had working separately. The error it gives is:

I/O Error
Cannot run program "stdbuf": java.io.IOException: error=2, No such file or directory

 

Do you have any ideas on why this might be happening?

Share this post


Link to post
Share on other sites

- If I use #include to include the cpu-specific register defs, the compiler doesn't find the symbols. This is cured by using '#include ', but I don't want to do this long term because the project I'm working on uses io.h and it's not all my code. The compiler flag is set in the project properties - the full options are '-I/opt/msp430tools/msp430/include -I/opt/msp430tools/include -O0 -g -Wall -mmcu=msp430f2274 -std=gnu89'

 

I am aware of this issue, and I'm not quite sure what is causing it. Somehow the MSP430_* defines don't get set properly, although they should. I'm working at it, but can't provide you with a timeline for a fix. Sorry.

 

- the debugger isn't starting. I'm using a recently compiled mspdebug, which I've had working separately. The error it gives is:

I/O Error
Cannot run program "stdbuf": java.io.IOException: error=2, No such file or directory

 

Hmm.. that looks really strange. What OS/Distribution are you using?

Share this post


Link to post
Share on other sites

Do you have any ideas on why this might be happening?

I guess you're using the distro tools. Try using the toolchain xpg provides and it should work.

 

To work around the 'unknown symbol' problem, I always include the specific device header file first and hit the build button. Then I can change that safely to . No big deal I think.

Share this post


Link to post
Share on other sites

@xpg:

 

The io.h fix would be good for me because the main thing I'm working on is trying to get contiki 2.5 working with the ez430, and contiki uses all over the place.

 

I'm using ubuntu 10.04 with eclipse indigo.

Share this post


Link to post
Share on other sites
The io.h fix would be good for me because the main thing I'm working on is trying to get contiki 2.5 working with the ez430, and contiki uses all over the place.

 

Though if necessary I could hack io.h to force it to include the right header file, and leave the contiki includes as they are.

Share this post


Link to post
Share on other sites

I think I've worked out what's happening with the debugging problem. stdbuf is a program for setting the input/output streams for a program. This program is missing from my system - I think it's meant to be in coreutils, but it was brought in after ubuntu 10.04, so I don't have it. I should be able to find a way round this somehow.

Share this post


Link to post
Share on other sites

Uh-huh. You're using the ubuntu packaged eclipse. I couldn't get my distris package to work with xpg very fine plugin. That was caused by a communication problem too and I'm running sid, so our packages are not far off.

 

I guess that could be my problem too. But I'm simply using the precompiled binaries. :wave:

Share this post


Link to post
Share on other sites
Uh-huh. You're using the ubuntu packaged eclipse. I couldn't get my distris package to work with xpg very fine plugin. That was caused by a communication problem too and I'm running sid, so our packages are not far off.

 

I guess that could be my problem too. But I'm simply using the precompiled binaries. :wave:

 

I'm actually using the precompiled eclipse indigo installation from the eclipse website. I spent a whole day trying to install msp430gcc myself a few weeks ago, and it felt like a waste of that work to switch ;-)

Share this post


Link to post
Share on other sites

I've now got it to upload code with mspdebug (by building my own coreutils from the GNU site), but the debugging session won't start. This is the error:

 

/bin/bash: /local/home/andy/workspace/Winky/Debug/Winky.elf: cannot execute binary file
/bin/bash: /local/home/andy/workspace/Winky/Debug/Winky.elf: Success

Share this post


Link to post
Share on other sites
I think I've worked out what's happening with the debugging problem. stdbuf is a program for setting the input/output streams for a program. This program is missing from my system - I think it's meant to be in coreutils, but it was brought in after ubuntu 10.04, so I don't have it. I should be able to find a way round this somehow.

 

Ahh, that's right. Oh dear, this is embarrassing. I use stdbuf to avoid buffering of stdout of the mspdebug program. Thanks for pointing out that it might not be in the distribution.

 

This is the error:

/bin/bash: /local/home/andy/workspace/Winky/Debug/Winky.elf: cannot execute binary file
/bin/bash: /local/home/andy/workspace/Winky/Debug/Winky.elf: Success

 

You have to create a new debugging target. See

http://www.youtube.com/watch?feature=pl ... 5QI#t=300s

 

/Paul

Share this post


Link to post
Share on other sites

OK, thanks. I've now got it to run the debugger, but it's still not picking up the right values for variables. This is the code I'm using:

 

#include 
// stdbool.h, so we can use booleans and true/false as constants
#include 

int main() {					// The main function
volatile unsigned int i = 0;
/* Disable the watchdog. The watchdog is on by default on an
 * MSP430, if we do not disable it it will reset the CPU after
 * 32k cycles in the standard configuration.
 */
WDTCTL = WDTPW + WDTHOLD;
// set P1.0 as output
P1DIR = BIT0;

// do forever:
while (true) {
	i++;
	if (i == 0) {
		/* Flip the value of P1.0's output register when i
		 * overflows to zero
		 */
		P1OUT ^= BIT0;
	}
}

}

 

There's a breakpoint on 'i++;', but the value of i comes up in the watch window as 63422, and doesn't increment when I run to next breakpoint.

 

Thanks for all your help so far by the way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×