Jump to content
yyrkoon

Code::Blocks + mspgcc how-to.

Recommended Posts

Congratulations for the Code::Blocks implementation and the nice videos!

 

Going to be playing with Visual Studio too. Both of these exercises have taught me a lot so far.

 

 

There is a very nice Visual Studio plug-in for embedded computing called Visual Micro, alas limited to Arduino only.

 

VMLogo2SmallWithInfo.png

 

It features software debugging by code injection. Feel free to contact its developer, Tim.

 

I've developed a similar template for Xcode, called embedXcode (websiteforum)

 

1551017.png?130

 

I'm looking for solutions to bring debugging capabilities.

 

 

Share this post


Link to post
Share on other sites

So, I did a bit of research ( a tiny bit ) followed by some experimentation, and it seems that debugging from within code::blocks is not going to be as easy as I had first anticipated. I can get mspdebug to accept a connection from gdb called by code::blocks, but that is about it. No memory dump, breakpoints, or anything that debugging is supposed to do works.

 

Granted, I know nearly ziltch about gdb, and it seems there is a ton of things I have to read before I may get this to work. So, this alone may turn into a long standing project of its own. I'll ask around a little, and see if this is going to be worthwhile overall.

Share this post


Link to post
Share on other sites

I had the same experience with gdb and Xcode.

 

I manage to use gdmanually with two Terminal windows, but connection to Xcode is almost impossible.

 

I think I've actually decided to write my own intermediate tool, and while at it, I may also just implement my own build tool based on msp430-GCC/G++ too. Although Rickta59 brought to my attention that there are already GUI front ends for GDB,

 

So yeah I am not 100% sure how I will approach this, but whatever I do, I am not just going to rush into things to get something out there *right now*. The end goal though, is a tool that can take a few cmd line arguments, and then build, upload, and debug *your* code, through a GUI, and have nicely formatted text to to read through.

 

Anyway a day or two ago, I wrote up a quick prototype, to give me a better idea of what I need to do, and how. Nothing that debugs and spits debug information out nicely formatted yet though.

 

Got a lot on my plate at the moment, so not sure how long it will take me. . .  Need to do a lot of reading on GDB, refresh my memory on various aspects of the .NET framework, my reflow controller code needs to be finished / polished, not to mention the every day mundane tasks of life. Not to mention the videos I plan on doing still . . .

Share this post


Link to post
Share on other sites
This IDE looks great ! Thanks for sharing.

 

But after all steps, video 1 and video 2, i got this message:

 

 

 

ld.exe                    cannot find -lstdc
 
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|

 

 
 
Do you have any idea ?
 
thanks.

Share this post


Link to post
Share on other sites

 

This IDE looks great ! Thanks for sharing.

 

But after all steps, video 1 and video 2, i got this message:

 

 

 

 
 
Do you have any idea ?
 
thanks.

 

Sounds like you did not set up the tool chain under the toolchain executable s tabs as I described. They must be set up exactly like shown in the picture below. You do not need to worry about the debugger, and make tools. Resource compiler is also not needed.

 

msp430-gdb and Code::Blocks do not seem to play well with one another anyhow . . . which is one reason why i want to build my own intermediate tool for the toolchain.

 

toolchain-executables.jpg

Share this post


Link to post
Share on other sites
Step 8. A quick overview of what a new user to the MSP430 Launchpad platform needs, in order to learn programming. Briefly cover where to find the MSP430x2xx family users guide, and a very quick explanation of the header file includes

 

Armed with this information we should then be able to start programming the device.

 

Share this post


Link to post
Share on other sites

Would anyone like to see anything specific ?

 

I am currently working on some ideas for videos, and I am aware, or at least I have this nagging feeling that I am not doing these videos right somehow. So any comments as to how I could improve my videos would be most welcome.

 

 Be harsh, or not it really does not matter as long as it is constructive.

Share this post


Link to post
Share on other sites
Hi, i followed all the steps but unfortunately it didn't work.
it show me some errors( i think that may be code::blocks cannot find the libraries). 

Do you have any idea what i can do to solve the errors ?

 

thanks  :smile:

 

post-32545-0-92695400-1368121073_thumb.png

Share this post


Link to post
Share on other sites

 

Hi, i followed all the steps but unfortunately it didn't work.
it show me some errors( i think that may be code::blocks cannot find the libraries). 

Do you have any idea what i can do to solve the errors ?

 

thanks  :smile:

 

 

Looks like a couple minor code errors:

 

error: '::main' must return 'int'

In function 'int main()':
error: 'P1DRI' was not declared in this scope
error: '_bis_SR_register' was not declared in this scope
error: '_delay_cycles' was not declared in this scope
 
For the first error, main() must be declared to "return" int -- use "int main(void)" instead of "void main(void)".  Also put a simple "return 0;" at the end of your main routine.  It will never get called which is silly but it's a convention that is required by MSPGCC.
Second error, looks like you misspelled P1DIR as "P1DRI" :smile:
Third and fourth errors, those functions have 2 underscores in front of them, not 1: "__bis_SR_register" and "__delay_cycles"
Give those a try.

Share this post


Link to post
Share on other sites

thank you a lot :D 

 

what you said were usefull . I'm new in programing and i don't know many things. I would like to ask something else i run the program and everything ok but i can't see the result in my MSP430 :(

What can i do for that? 

 

these is  my code : 

 

 

#include <msp430g2553.h>
#ifndef TIMER0_A1_VECTOR
#define TIMER0_A1_VECTOR TIMERA1_VECTOR
#define TIMER0_A0_VECTOR TIMERA0_VECTOR
#endif
 
int main(void)
{
 
 
WDTCTL = WDTPW + WDTHOLD; 
 
P1DIR = 0x40; 
P1OUT = 0; 
BCSCTL3 |= LFXT1S_2; 
IFG1 &= ~OFIFG;  
 
__bis_SR_register(SCG1 + SCG0);
 
BCSCTL2 |= SELM_3 + DIVM_3; 
 
while(1)
{
P1OUT = 0x40; // LED on
__delay_cycles(100);
P1OUT = 0; // LED off
__delay_cycles(5000);
}
     return 0;}

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

×