Jump to content
Sign in to follow this  
yyrkoon

gcc-msp430 and Visual C++ 2010 express.

Recommended Posts

Does anyone know how much work would be involved in setting up Visual C++ express 2010 using gcc-msp430 ?

 

This is something I personally have interest in using. But do not have the slightest idea how to setup. That said I am fairly certain is is possible as indicated by the VisualGDB product. 

Share this post


Link to post
Share on other sites

I think VC++ can use external makefiles. So you just create a make file and you can use VC++ for your editor.

 

[Edit:] Looks like someone spelled out what to do with avr-gcc and avrdude. You just need to modify for msp430-gcc and mspdebug http://www.instructables.com/id/Use-Visual-Studio-2010-to-Compile-AVR-Hex-Files/#intro

Share this post


Link to post
Share on other sites

Rick, thanks I will check it out. What I was getting at though, was using Visual C++ as an editor, and compiler. Handling all the makefile stuff etc auto magically.

 

Again, not something I am really familiar with, but I will definitely check out your link.

Share this post


Link to post
Share on other sites

Yes sir, and I have considered it. Demoing their plugin is something I have been wanting to do for a while now, but have not got to yet.

 

After briefly reading the link you gave me though, it seems to all intents and purposes, what I want to do translates over to the msp430's In all honesty, I find visual studio a bit clunky, but I really love the intellisense feature.

Share this post


Link to post
Share on other sites

I actually found an article written by one of the co-founders of SysProgs ( VisualGDB plugin ), where he described using Visual Studio in a round about way to use external gcc compilers.

 

After reading this article I am confident that it *is* possible to use visual studio to write source, compile the same source using gcc through Visual Studio, link to it, and upload the resultant hex file to just about any device through mspdebug. The catch is, this required windows batch file debotchery. Which is to say, less than optimal. However, with that said, it may be possible to use something else, such at writing an external application, which Visual studio calls to invoke gcc. I've yet to explore this.

 

At this point, I've relearned a lot about batch files, and have something that uses the Energia toolchain to compile source files into object files. I've spent all of today, and part of yesterday working this all out, but am confident that what I stated in the above paragraph holds true.

 

The tricky part here for me is that I am learning much of this as I go. It's been probably well over 10 years since I even bothered to look at a batch file. I have limited experience with command line compiling, and I know very little about how Visual Studio works on a lower level. Plus I am using the Express version of the IDE, so plug-ins extension, add-ons etc are a no-go. The bonus for this last part however is that the development environment is free.

 

If anyone would like a write up let me know. I would be happy as soon as I am done.

 

Anyway, this is what I have so far below, and I am not done by a long shot !

 

vsdebotchery.jpg

Share this post


Link to post
Share on other sites

Another quick shot of the IDE in action with error reporting working. This again was part of the article I've read, and using the authors code to correct gcc's UNIX style file / path format, to play nice with Visual studio.

 

Optimally, I would prefer to write a C# application that took the place of both the batch file, and now the perl script that I am currently running through cygwin. However ! Error reporting does work correctly, and when you click on the given error in the error message dialog. The IDE will take you straight to the error in your code. Awesome!

 

vsdebotchery2.jpg

Share this post


Link to post
Share on other sites

Anyway, here is the link to the article for those who want to play. It is pretty straight forward, and as you will see, is not limited to msp430-gcc alone. Still think it would be better to write a real app to take the place of the batch and perl scripts. And I have a pretty good idea how it can be done ( minus the reg-ex stuff yuck ! ). Bed time though, will continue working on it later today, after i get up.

Share this post


Link to post
Share on other sites

So I've finished the batch file, and I am not 100% happy with it. It does work, but the reason why I am unhappy with it is that it is a bit hackish. Partly because this is done using and Express version of Visual Studio.

 

Also now that I understand a bit more of the command line build process, I am seeing that using make *could* be better in some ways. However, even using make would still be a hack.

 

Other parts of why I feel that this is hackish, is because the batch file "script" relies on several things such as being in the project directory that you're working on. Relies on perl for the error reporting re-mangling, and several other  "hard coded things". Granted the script does take a single command line parameter, to point the script at the proper tool chain path. The script also takes all source files in the given directory and compiles them into the final hex file. also Relying on finding a *.sln file ( recursively) in the directory tree, to provide a solution exact project name for the resultant elf, and hex files.

 

Anyhow, anyone interested in toying with this script let me know via here or PM ( or even IRC ), and I will link you to a pastebin of what I have so far.

 

An no, before anyone asks my reflow oven controller code is not actually that small. this is just a simple example I was experimenting with to use with that code. Proven working, and VS produces same code size for the target that the Energia tool chain does. Which is no surprise since I am using the Energia tool chain for my experiments here.

 

Meanwhile, I am going to continue my experimenting, and try to get something else working that I am more happy with.

 

vsdebotchery3.jpg

Share this post


Link to post
Share on other sites

Well I have finally come up with a way to setup Code::Blocks to more easily, and generically setup a project, and based on that project create a user defined template.

 

I still prefer Visual Studio for an IDE, but for now until I figure out something better, I'll be using Code::Blocks. This does not mean I am done here. Quite the contrary actually, but from what I have been reading it will take me a while to figure everything out. The PitA being Visual C++ 2010 express. With the professional version of the IDE, this would all be relatively trivial. But still a good bit of work.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...