Main Site Documentation

Medusa debugging using Visual Micro's "Arduino for Visual Studio"


#1

I’ve spent the last couple of days getting myself up to speed with Arduino development using an Uno board to play with the Medusa examples.

One of the things I’m really exited about was to find the Visual Micro tool(http://www.visualmicro.com) has got a plug-in that allow Arduino sketches to be developed in Visual Studio and it even offers debugging. So far I’ve been able to use it to compile Medusa code without a problem, but I could not yet get the debugging working. When I just use pure Arduino code, then I can debug it just fine, but when I try the same on Medusa code samples it simply ignores my breakpoints. But I’m sure there is an obvious reason for it and it will eventually be sorted out.

So, I’m curious if anybody else here have looked a bit at Visual Micro’s tool. It looks like it has a lot of potential and offers at least three advantages over the standard Arduino IDE:

  1. Visual Studio IDE instead of Arduino’s legacy IDE.
  2. Ability to use breakpoints and traces on Arduino
  3. Using Intellisense and code completion on the Arduino environment.

Lets hope some cleverer than me will figure out how to get the debug stuff sorted as well.

Werner


#2

I have no idea but I did find this.

Do you need this?
http://www.visualmicro.com/post/2012/05/05/Debug-Arduino-Overview.aspx


#3

Thanks Will. I was able to get the debug working on regular Arduino scripts, but when I tried it on some of the Medusa examples it did not work. Anyway, it sounds like debugging using a Lynx will be more useful.


#4

I tried to Setup everything in advance before I get my MedusaMini.
So I Installed Arduine IDE 1.5.5, Gadgeteering SDK 2013 R1 and VisualMicro.

But when I try to build the sample from Getting Started in VS2013 I get an error:

System.NotSupportedException: The given path's format is not supported.
   at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
   at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath)
   at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
   at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
   at System.IO.DirectoryInfo.Init(String path, Boolean checkHost)
   at System.IO.DirectoryInfo..ctor(String path)
   at processing.app.Board.get_boardVariantFullPath()
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Project oProject, Boolean IsDebugStartCommand)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)

When I click verify in Arduine IDE for the same sketch it looks OK.
Also when I change the selection in VS2013 Toolbar from FEZ Medusa to Arduino Uno it compiles well.
Has anyone an Idea what could be wrong here?


#5

@ Reinhard Ostermeier: I don’t have Mendusa, but when I playd with my “Arduino on breadboard” I had to move board definition for my board from Arduiono IDE folder \Hardware\breadboard (inside that folder there is boards.txt file) to \My documents\Arduiono\hardware\breadboard).


#6

@ jernejk - I’ll give it a try, thank you.


#7

Ok, I had to do two things to get it work:

1st I compared the boards.txt for Medusa and Uno.
The only difference was 4 entries which were different

medusa.upload.tool=arduino:avrdude
medusa.bootloader.tool=arduino:avrdude
medusa.build.core=arduino:arduino
medusa.build.variant=arduino:standard

I changed them to

medusa.upload.tool=avrdude
medusa.bootloader.tool=avrdude
medusa.build.core=arduino
medusa.build.variant=standard

Then the path exception when compiling in VS was gone.
But Wire.h and SPI.h could not be resolved.
These are below C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries
But Medusa boards.txt is originally in MyDocuments\Arduino\hardware\GHI Electronics\avr
So I copied the bootloader files from MyDocuments to Programs and copied the content of the Medusa boards file to the common boards file.
Now everything in VS compiles as expected.
Unfortunately I can not test any more, because I don’t have my hardware yet :frowning: