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] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Intellisense issues with Arduino DUE and VS2013 (Read 32991 times)
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Intellisense issues with Arduino DUE and VS2013
Jun 2nd, 2016 at 2:02pm
Print Post  
Is there any way to fix intellisense in VS 2013? I am working with Arduino DUE, and it appears none of the PORT/Register names are known, for example, PIOA/PIOC etc PMC also, I am new to Visual Micro but it is not inspiring to have a screen full of red blobs for a project that compiles and works fine in the Arduino IDE!  Sad

Regards,

Graham
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #1 - Jun 2nd, 2016 at 2:51pm
Print Post  
I'll take a look thanks.

Microsoft have been changing the intellisense system so tend to test more with vs2015 these days. Having said that it's never been 100% perfect because we rely on vs c++ for intellisense. 

Good news is that Microsoft have released support for clang (as opposed to windows c++) which means intellisense will just work without my having to massage it every few months Smiley
  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #2 - Jun 2nd, 2016 at 3:06pm
Print Post  
I am in the process of downloading VS2015, but I guess that will bring it's own problems too.

Thanks,

Graham
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #3 - Jun 2nd, 2016 at 5:25pm
Print Post  
I can't promise it will be any different but might well be
  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #4 - Jun 2nd, 2016 at 8:30pm
Print Post  
So after gloriously wasting 2 hours installing 2015, nothing changes....

Enclosed is a zip with a sketch, compiler output, and screen shot of intellisense errors.  

Hope you can do something because I have a project that will require the debug features, but not looking good so far...  Cry

Regards,

Graham
« Last Edit: Jun 2nd, 2016 at 8:31pm by ghlawrence2000 »  

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #5 - Jun 2nd, 2016 at 8:48pm
Print Post  
Thanks for the info. 

I have replicated with the latest arduino sam core (1.6.9) and will look into it.

Hopefully there will be an update during the next week or so.

In the meantime you can right click the "error list" and switch off show intellisense errors which will at least let you see clear and accurate errors after a build. You will still see the annoying squiggles.

In the meantime if you are inclined to fool the intellisense system there is a post here that explains how to make dummy values by using the #define(MSC_VER) condition in a dummy .h

http://www.visualmicro.com/page/Extending-Visual-Studio-Intellisense.aspx

Thanks for the report.
  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #6 - Jun 2nd, 2016 at 8:52pm
Print Post  
Thanks, I shall look forward to it.

Regards,

Graham
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #7 - Jun 2nd, 2016 at 10:03pm
Print Post  
I looked at your code again and found that F12 and shft+f12 were working fairly well. The main issue seemed to be that you have #defined values that are also macros making use of other code files. 

The compiler finds the code okay but the intellisense doesn't. Adding an #include doesn't hurt. You can also enclose it in VSIntellisense only #if conditions so that the real arduino comple ignores but it kinda makes sense doesn't it?

Adding this resolved all the errors you mentioned.

Code
Select All
#if defined(_MSC_VER)
  #include "sam3xa.h"
#endif
 



I also found that 2 more errors can be resolved by adding the __arm__ def which has been added to the next release.

Code
Select All
#if defined(_MSC_VER)
  #include "sam3xa.h"
  #define __arm__
#endif
 



I have removed a rogue define for __ICCARM__ from the next release for the sam boards. It reduces the errors by 3 and is a more accurate representation for sam.

Hope that helps
« Last Edit: Jun 2nd, 2016 at 10:05pm by Tim@Visual Micro »  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #8 - Jun 2nd, 2016 at 10:23pm
Print Post  
Awesome!!

That makes huge inroads into the problems, but you will appreciate that I only gave you a small sample of the sketch causing the problems..... I still have problems.

Would like the full sketch?

Thanks,

Graham
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #9 - Jun 2nd, 2016 at 10:26pm
Print Post  
Yes please and also say where to download any libraries or include them in the zip

Thanks
  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #10 - Jun 2nd, 2016 at 11:06pm
Print Post  
Here you go.

Regards,

Graham
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #11 - Jun 2nd, 2016 at 11:09pm
Print Post  
You will also need this library.

250KB maximum attachment size??? That's a little tight..

Regards,

Graham
  

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #12 - Jun 2nd, 2016 at 11:52pm
Print Post  
Thanks, by the way you should switch off debugging until you have a working compile.

I don't have the sdfat library

Vs with the current c++ is not able to understand some gcc syntax which is why intellisense will move to using a ctags based engine in VS. 

You can add dummy methods  to kick the intellisense into shape. You can probably just add to a .h and include in the project without need to #include in the actual code.

Code
Select All
#if defined(_MSC_VER)
#include "sam3xa.h"
#define __arm__
int isdigit(char __c) {}
int strlen(char[]) {}
int strcpy(char[], char[]) {}
void sprintf(char[], char[], int) {}
void sprintf(char[], char[], char[], char[]) {}
#endif
 


  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #13 - Jun 2nd, 2016 at 11:59pm
Print Post  
Yep, you are definitely on the right track!!

Only one error now, but it compiles too!!

Thank you so much!!

Regards,

Graham

Edit

#if defined(_MSC_VER)
#include "sam3xa.h"
#define __arm__
int isdigit(char __c) {}
int strlen(char[]) {}
int strcpy(char[], char[]) {}
void sprintf(char[], char[], int) {}
void sprintf(char[], char[], char[], char[]) {}
void sprintf(char[], const char[], char[]) {}

#endif

fixes the last error
« Last Edit: Jun 3rd, 2016 at 12:01am by ghlawrence2000 »  
Back to top
 
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #14 - Jun 3rd, 2016 at 12:16am
Print Post  
Would it be worthwhile creating a central repository for these intellisense fixes?

I appreciate I am only a newbie, and without your help would not have got to the bottom of this, so with that in mind, I think it would be beneficial....

Thanks again for your excellent support!

Regards,

Graham
  
Back to top
 
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #15 - Jun 3rd, 2016 at 10:21am
Print Post  
Hi Tim,

I realise now how impractical the central repository for intellisense fixes is  Grin. I have had chance to play some more, and had to add several more to the list, which made me realise there will never be a one size fits all solution, ah well...

Now, I have another problem.

I loaded another sketch, shuffled around the order of functions to remove not defined errors, (which didn't trouble the Arduino IDE?) and I have a fully compilable sketch in 'Release' mode. However when I select 'Debug' mode I get this :-

Flash_MultiFunction-hispeedUSB-extended-oc.ino:572:16: error: 'MicroDebug' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Error compiling project sources

I have no break-points set yet, and I REALLY hope the DUE is supported for debugging?

Thanks,

Graham
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #16 - Jun 3rd, 2016 at 6:01pm
Print Post  
Hi,

Quote:
I realise now how impractical the central repository for intellisense fixes is  Grin. I have had chance to play some more, and had to add several more to the list, which made me realise there will never be a one size fits all solution, ah well...


Agreed, that's why I mentioned and gave link to discussion about trying the new clang system for users who have time to test and try it. It will solve all the intellisense issues and be easier to configure within the next few months.

Quote:
I loaded another sketch, shuffled around the order of functions to remove not defined errors, (which didn't trouble the Arduino IDE?) and I have a fully compilable sketch in 'Release' mode


The Arduino Ide doesn't have intellisense or report code errors until compile so it won't be "troubled" Smiley 

You can switch off intellisense error reporting in Visual Studio "tools>options" if you want to compare apples with apples and the Arduino Ide.

Quote:
I have a fully compilable sketch in 'Release' mode


So Visual Micro is compiling the same as the Arduino Ide in Release mode and not having any troubles?

Quote:
However when I select 'Debug' mode I get this :-

Flash_MultiFunction-hispeedUSB-extended-oc.ino:572:16: error: 'MicroDebug' was not declared in this scope
:void setup() { 
    debugger: The error shown above might be caused by invalid breakpoint syntax or the board is not yet supported for debugging (pls let us know!)
Error compiling project sources


Yes the Due is supported however you have to keep in mind that it can only debug by injecting serial statements into the temp code during compile. It's probably an issue determining where to insert code.

If you can email the MultiFunction-hispeedUSB-extended-oc.cpp file from temp build folder I will be able to see what is happening.

Thanks
  
Back to top
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #17 - Jun 3rd, 2016 at 6:47pm
Print Post  
I am in demand this evening, and didn't even get beer yet, I will get back to you....  Grin

Thanks,

Graham
  
Back to top
 
IP Logged
 
ghlawrence2000
Junior Member
**
Offline


Posts: 35
Joined: Jun 2nd, 2016
Re: Intellisense issues with Arduino DUE and VS2013
Reply #18 - Jun 3rd, 2016 at 9:25pm
Print Post  
Hi Tim,

Sorry for the delay, please find enclosed the file requested.

Regards,

Graham

Edit: Or did you want that file after th debug compile failed?
« Last Edit: Jun 3rd, 2016 at 9:29pm by ghlawrence2000 »  

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


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense issues with Arduino DUE and VS2013
Reply #19 - Jun 4th, 2016 at 12:14am
Print Post  
Thanks. I need to see the file after an upload attempt with debug. Doesn't look like there is any debugging in the file.

I also suggest moving the if define(msc_ver) to a .h file. That might fix the debug anyway.

The .h file doesn't need to be #included in your code, vs will see it and use it as long as it is included in the project.

Out of interest is all your code in a single .ino?
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint