VisualStudio-PropGCC

Home Up

 

bullet

Visual Studio 2010 is our preferred environment for Windows C++ development.  Here we take a look at using VS 2010 as our IDE for Propeller C/C++ development

bullet

This is an unsupported use of Visual Studio and it's not perfect...

bullet

Download this example solution with several of the demos as projects inside. (or see how I did it by reading further down)

bullet

Inside VS, push the green play button ("Start Debugging") to compile load the Propeller.  You can also just "Build" to check for errors first.

bullet

This solution comprises several projects.  Select the active project from the "Solution Explorer" by right-clicking on it and picking "Set as StartUp Project".

bullet

These project all have a build.bat file that is rigged to run in lmm or cmm mode.  They should all work in either mode.  You can edit the build.bat file to try other modes.

bullet

This is a work in progress, but here is how we build and run:

bullet

Install PropGCC

bullet

Create a "Makefile Project" in Visual Studio

bullet

We are not actually going to use makefiles, but we pretend we are...

bullet

Using the Wizard:

bullet
Set "Build command line" to "build.bat"
bullet
Add "c:\propgcc\propeller-elf\include" to "Include Search Path" 
bullet

Add your source .c or .cpp files to the project.

bullet

Create a new file called build.bat that will use the command line tools and add it to the project.

bullet

Edit build .bat and add lines like this that execute the command line tools to build the project:

bullet
del a.out
propeller-elf-gcc.exe -o a.out -Os -mcmm -I . -fno-exceptions -mp2 Hello_P2.c
propeller-elf-objdump -h a.out
bullet
We do the "del a.out" to make sure we are compiling and running a fresh version
bullet
propeller-elf-gcc does the compiling to create the a.out file
bullet
the  
bullet

Edit the Project-->Properties

bullet

Under NMake:

bullet

set "Build Command Line" to "build"  (this will execute build.bat when we select "build" from the menu) (if not done by wizard)

bullet

set "Output" to "c:\propgcc\bin\propeller-load.exe"  (this will now run when we push the play button in debug mode)

bullet

Add "c:\propgcc\propeller-elf\include" to "Include Search Path"   (if not done by wizard)

bullet

 Under Debugging:

bullet

set "Command Arguments" to those you need for propeller-load, for example:

bullet
-I C:/propgcc/propeller-load/ -b DE2-115 a.out -r -t
bullet
You will need to change the settings on the above line to match your board and com port
bullet

Now, you should be able to use the "build" and "Start Debugging" commands!

bullet

It may complain about not having debugging info, but just tell it not to bother you again about that.

bullet

Intellisense:  Getting this to work is the hard part...

bullet

VS will put red squigglies under errors and things it doesn't understand.  Getting it to understand Prop GCC code is tough...

bullet

The step above where we added the propeller-elf\include to NMake helps a lot.

bullet

 Need to figure out how to make it recognize things like "waitcnt"