Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Cosa Debugging (Read 7563 times)
EnglishBob
Newbies
*
Offline


Posts: 8
Joined: Mar 27th, 2016
Cosa Debugging
Mar 27th, 2016 at 11:06pm
Print Post  
Sigh, I'm sorry - I tried everything I could think of, but I'm out of ideas.

Fresh install of VS2015 with VM extension, fresh install of Arduino 1.6.8. Tried downloading Cosa 1.1 and 1.2 via both the VM board manager and manually to the Arduino IDE (before installing VM - I've done a lot of rollbacks!)

I can select the vanilla Uno, paste in the Blink example and compile for debug just fine.

If I select the Cosa Uno and paste in the CosaBlinkMinimal example, it compiles perfectly - in Release.

As soon as I switch to Debug...boom. A ton of errors related to redefining and overloading. 

From looking at previous forum posts and the VM_DBG file, it looks like you should be able to support debugging with Cosa...so I can't work out what I'm missing, or whether I've installed incorrectly.

I've attached two text files with the results of the build output, and can test/change anything you need if you need additional help/info.

VS is my IDE of choice for all my coding, and Arduino debugging is something I would seriously love to take advantage of - but Cosa has way too many advantages for me to switch back to vanilla just to get to debug.

Any help would be appreciated.

Thanks.

« Last Edit: Mar 27th, 2016 at 11:12pm by EnglishBob »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cosa Debugging
Reply #1 - Mar 28th, 2016 at 11:54am
Print Post  
Thanks for the report. Cosa keeps changing  Undecided

It's best to use the arduino ide boards manager then click "tools>visual micro>reload toolchains" or restart the vm ide. That way we know that both arduino and vm should be working identically except when vm is in debug mode.

I found it works with 1.1 but not 1.2. 

I had 1.1.0 installed and debug was fine.

Then I installed 1.2.0 using the arduino boards manager, clicked reload toolchains and debug build failed.

Then I used boards manager to install the 1.1.0 and debug build worked again.

So hopefully you see the same?

  
Back to top
IP Logged
 
EnglishBob
Newbies
*
Offline


Posts: 8
Joined: Mar 27th, 2016
Re: Cosa Debugging
Reply #2 - Mar 28th, 2016 at 7:42pm
Print Post  
Yep - that got me pointed in the right direction. Discovered I don't even need to technically "load" the different versions, I can just replace files under hardware/Cosa, force a VM rescan and replicate the error on demand.

With this, I narrowed down the single cause to the boards.txt file - I can install 1.2, replace that single file with the 1.1.1 version and compile without error.

Analyzing the file changes (apart from the significant number of boards deleted), there was only one difference...

v1.1.1
Code
Select All
uno.build.core=cosa 



v1.2
Code
Select All
uno.build.core=Cosa:cosa 



I had a (somewhat blind) hunt around the rest of the source and online to try to figure out what the significance of the colon might be, but couldn't find anything that mentioned it. 

Had a quick look back at the original thread I found, and based on http://www.visualmicro.com/forums/YaBB.pl?num=1421322718/11#11 I'm going to guess that broke your automatic detection of Cosa core boards Tongue

So, I just did a search/replace on the 1.2 boards.txt file, replacing Cosa:cosa with cosa, and success. I was able to compile, upload and hit the breakpoint without any problems.

Now with that said, I couldn't get @ReportDigital working - either with v1.1.1 or v1.2. The original thread said you were having issues, but I was hoping there'd been progress over the last year Sad 

Is there anything we/I can do to help? Is it still related to the idea that the pins are hardcoded constants?

On a side note, I'm getting intellisense errors on macro defined functions (such as PSTR). Intellisense correctly identifies the related #define command, but throws a "expected an expression" error...and I'm not sure how to (or if it's possible to) manipulate the header file to counter this
(as per Extending-Visual-Studio-Intellisense.aspx).

Thanks for your speed response so far, much appreciated. A pro license is already pretty much a foregone conclusion at this point. If I can get the pin reads working, it's guaranteed Tongue
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cosa Debugging
Reply #3 - Mar 28th, 2016 at 10:46pm
Print Post  
Thanks very much that saved me a ton of time. A new version was due so the fix was included in that (just published).
  
Back to top
IP Logged
 
EnglishBob
Newbies
*
Offline


Posts: 8
Joined: Mar 27th, 2016
Re: Cosa Debugging
Reply #4 - Mar 28th, 2016 at 11:29pm
Print Post  
That was fast! Cheesy Looks like that got it, glad to have helped.

Any ideas on the digitalRead error or advice on fixing the macro intellisense errors?

Also, for future reference, do you prefer multiple threads to be created for multiple issues to assist with tracking, or is lumping them together like this acceptable?

Thanks.

<edit>For what it's worth, I was able to get a read on a pin by putting
Code
Select All
{Pin::read(Board::D2)} 

into the breakpoint action - I was toying with the idea of writing a function to go through each pin this way, but then realized the Expressions window would only show a single line Sad 

Is there a way to have a single expression output multiple variables? I intercepted the serial output to see if I could add something, but it looks like you're doing all the heavy lifting on the IDE end Tongue
</edit>
« Last Edit: Mar 28th, 2016 at 11:44pm by EnglishBob »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Cosa Debugging
Reply #5 - Mar 28th, 2016 at 11:37pm
Print Post  
Thanks, yes multiple threads are easier for people to search for solutions.

The system uses the digital discovery from the same code as the firmata library.

You can find the code in vmboards.cpp/h in the "visual micro\micro platform\default\debuggers\vm_dbg" folder.

Visual micro folder is shown in tools>options>visual micro>version>assembly.

If you do want to chat about it some more then feel free to create a new thread with questions. (I don't know the digitalRead command for cosa so this is a on working example assuming the code is "cosa.pin(5)")

but you can also use the chart/plot command in a breakpoint "whenhit" {@plot.myChart.ThisIsPin5 cosa.pin(5)}

Thanks again
« Last Edit: Mar 28th, 2016 at 11:40pm by Tim@Visual Micro »  
Back to top
IP Logged
 
EnglishBob
Newbies
*
Offline


Posts: 8
Joined: Mar 27th, 2016
Re: Cosa Debugging
Reply #6 - Mar 28th, 2016 at 11:46pm
Print Post  
Lol, wasn't expecting such a speedy response, your reply beat my edit above.

Thanks for the tip, I'll go poke in there and start a new thread if I discover anything.
  
Back to top
 
IP Logged
 
EnglishBob
Newbies
*
Offline


Posts: 8
Joined: Mar 27th, 2016
Re: Cosa Debugging
Reply #7 - Mar 29th, 2016 at 4:15am
Print Post  
For anyone reading this and hoping for a solution, I started a thread at http://www.visualmicro.com/forums/YaBB.pl?num=1459219196 that may contain an answer.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint