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
Hot Topic (More than 8 Replies) VS2017 Locks up (Read 3100 times)
Steve R
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2018
VS2017 Locks up
Jul 12th, 2018 at 12:48am
Print Post  
I'm using W10, and the latest version of VS2017 and Visual Micro for the Arduino Mega. The project compiles under the Arduino IDE with no issues.

Under VS, I'm getting Intellisense weird macro warnings, and even moving the mouse over a red squiggly error will lock up VS. The problem code is a big array (a font) that starts out like this:

const  uint8_t SevenSegment96x144Num[17284] PROGMEM = {
     0x60,0x90,0x30,0x0A,

If I uncomment this line, I get the red squiggle under the font name, and putting the mouse over it is death to VS:
myGLCD.setFont(SevenSegment96x144Num);

My other Arduino projects work fine, just started on this one, and wow, it doesn't like it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2017 Locks up
Reply #1 - Jul 12th, 2018 at 11:19am
Print Post  
Thanks for the info.

Visual Micro does not have any involvement in the code editor. It simply gives Visual Studio folders and defines for its standard C++ intellisense. It would be too complicated to interfere with UI side of the the Microsoft C++ intellisense in the code editor and be too difficult to debug issues.

So looking at your issue I have a few initial comments/pointers...

1)
It would be useful to try the same syntax in a new lean project. If the same problem exists then pls zip and email the project to info[at]visualmicro.com along with a link to this project and list of libs to install to text 

2)

If the same problem does not exist in 1) then email your entire project if possible.

3)

Microsoft is responsible for the intellisense system unless you have installed another extension that is doing what I have said Visual Micro avoids. Please use help>about to confirm what you have installed.

4)

Please use help>about o confirm your VS version.

Summary

Note that it is possible that you have an intellisense error that builds okay. The VS intellisense is not 100% perfect but in most cases we can add a workaround to visual micro to avoid the red squiggles etc.  However, we would not expect a line with red squiggles to crash when viewed therefore we have two different and supposedly unrelated discussions.


  
Back to top
IP Logged
 
Steve R
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2018
Re: VS2017 Locks up
Reply #2 - Jul 12th, 2018 at 4:15pm
Print Post  
This is with VS 2017, version 15.7.5. And your plugin is version 1807.8

I did some more testing this morning, it will lock up with just the font definition in PROGMEM. No libraries, not a single line of code defined except empty setup and loop functions. No compiling, nothing, paste in the font definition, and at some point after that it locks up dead, in some sort of loop, as it is eating up cpu (not 100%, but 100% on one of the cores).

It is the PROGMEM that is messing it up. It seems to be when I pass the mouse over the squigglies that it fails. However, it isn't always failing in my very small test program. But it did fail the first several times.

I don't even have the Arduino hooked up to the USB, I don't need to upload it. I did get it to more consistently crash with the UTFT library, but still a very short program, which I emailed to you. In this test, I can even remove the PROGMEM, and the error still happens when you hover the mouse over the red squiggles on the byte array name on the line setFont line (line 39).

I appreciate any help you can give.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2017 Locks up
Reply #3 - Jul 12th, 2018 at 4:23pm
Print Post  
Hi,

Please ignore the intellisense error for a moment and don't hover the red squiggles.

Ensure the tool bar is set to Release and not Debug and then click Build.

We need to see if the build is working. It should be the same as the arduino ide.

The intellisense is a different discussion so this will give us a base line.

Building also provides more accurate intellisense although I don't expect it to resolve the intellisense error you are seeing.


Info

You are not missing anything, the issue is that the visual studio intellisense doesn't understand some syntax such as PROGMEM, hence the red squiggles. 

The lock up could be that visual studio is searching your installed tool chains and trying to build the intellisense indexes but a virus checker is causing it to grind to a halt. Did you check task manager processes during lock up to see what is consuming cpu?

After you confirm the build same as arduino we can look at the intellisense some more. thanks
  
Back to top
IP Logged
 
Steve R
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2018
Re: VS2017 Locks up
Reply #4 - Jul 12th, 2018 at 4:54pm
Print Post  
It does build, as long as my mouse doesn't go over the red squigglies. And yes, I've noticed a lot of times the Intelisense isn't correct, until I do a build, if I added an include file for example. That's no problem, once I understand that.

If I do something like add an additional line of code using the same name of the font, it doesn't get the red squiggles on that line, only on the setFont line.

Code (C++)
Select All
uint8_t b2 = SevenSegment96x144Num[0];
	myGLCD.setFont(SevenSegment96x144Num); 



Just now it didn't lock up when I hovered over the error (the first time, then it did!). I did switch to Release mode. It did pop up a real intellisense msg, which I didn't read all the way, as I moved my mouse and when I moved it back on, then it locked up. It did say something about the uint8_t pointer or something. I killed that after ten minutes of lock up, and tried again, but it just locked up right away when I hovered over the error.

The cpu only goes up for VS (to 7 or 8%). It doesn't go up that much, I thought it was almost pegging one core, but it turns out that core is always about 70% or so, another program apparently.
  
Back to top
 
IP Logged
 
Steve R
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2018
Re: VS2017 Locks up
Reply #5 - Jul 12th, 2018 at 5:45pm
Print Post  
I tried uploading it to the Arduino, and the added fonts also still work correctly. So I can continue working on my software, as long as I don't accidentally drag my mouse across those false errors.
  
Back to top
 
IP Logged
 
Steve R
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2018
Re: VS2017 Locks up
Reply #6 - Jul 12th, 2018 at 8:24pm
Print Post  
Getting rid of the "const" when declaring the font gets rid of the error when using the setFont call, and the whole problem seems to go away at that point.

Code (C++)
Select All
uint8_t SevenSegment96x144Num[17284] PROGMEM = { 



The above line used to have "const" right at the start of it, which was causing the Intellisense to really mess up.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2017 Locks up
Reply #7 - Jul 12th, 2018 at 11:08pm
Print Post  
It locks up for me to in vs2017 15.8 preview 3 so we will see if same exists in the new preview 4

Building removed all squiggles from the definition and PROGMEM was fine. However the squiggles and hang happened for the  myGLCD.setFont(SevenSegment96x144Num) call. 

I suspect this is because your font defs are over 8000 chars per line or some other memory issue when visual studio attempts to show a intellisense hint for the definition of some so wide.

It's possible that a simpler non-arduino windows c++ example without PROGMEM would also give the same result in a  visual studio c++ project (not using visual micro). If this is the case it will be easy to report to microsoft.

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VS2017 Locks up
Reply #8 - Jul 13th, 2018 at 7:05pm
Print Post  
Microsoft has fixed the crash in Visual Studio 15.8.0 Preview 4. The preview version can be installed side by side with normal visual studio and isn't much different. Sometimes early Previews are a bit buggy but Preview 4 is quite mature now.

but the intellisense error still shows

To resolve the intellisense error I pressed F12 and changed the signature of the setFont method in the library .h and then in the .cpp because otherwise there is a build error. The build error takes you too the cpp.

Code (C++)
Select All
setFont(const uint8_t* font) 



It's possible there is some visual studio pragam or option to tell it to be less strict, it's a bit annoying.

« Last Edit: Jul 13th, 2018 at 7:08pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint