Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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 and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Serial does not work with the grbl library (Read 615 times)
Lee Critchlow
Newbies
*
Offline



Posts: 8
TN
Serial does not work with the grbl library
Aug 11th, 2022 at 7:08pm
 
I am attempting to install grbl on a Mega 2560. I downloaded the library from GitHub  gnea/grbl-Mega. The errors are: multiple definition of max, min, & bit, multiple definition of __vector_23, multiple definition of __vector_25, and multiple definition of __vector_26. I've used #ifndef for duplicates of variables but I do not know what to do with the ISRs. With a little research, I think it has something to do with the existence of wiring.c.o, which I believe is not used by the grbl library.
I used Arduino IDE to compile and upload the original grbl with success. Then when I used vMicro Port Monitor, I get the grbl Welcome Message. However, when I type various grbl commands, all I get is two 'ok's.
Do I just comment out the offending ISR definitions or is there another answer?
Back to top
« Last Edit: Aug 12th, 2022 at 8:44pm by Tim@Visual Micro »  

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



Posts: 11537
United Kingdom
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #1 - Aug 11th, 2022 at 7:21pm
 
Please switch the configuration name on the toolbar to Release and then attach the output again after build/upload.

In Release mode Visual Micro should be exactly the same as the Arduino IDE. After that is proven we can discuss debug options.

Thanks
Back to top
« Last Edit: Aug 11th, 2022 at 8:30pm by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Lee Critchlow
Newbies
*
Offline



Posts: 8
TN
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #2 - Aug 11th, 2022 at 11:05pm
 
Release compiled. Smiley
Back to top
« Last Edit: Aug 11th, 2022 at 11:06pm by Lee Critchlow »  

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



Posts: 11537
United Kingdom
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #3 - Aug 11th, 2022 at 11:12pm
 
Great. If you add a Serial.begin(115200); to your code does it still compile and link correctly?
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Lee Critchlow
Newbies
*
Offline



Posts: 8
TN
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #4 - Aug 11th, 2022 at 11:22pm
 
grblUpload.ino -> #include <grbl.h> // Do not alter this file!
Should I add a setup & loop?
Back to top
« Last Edit: Aug 11th, 2022 at 11:23pm by Lee Critchlow »  
 
IP Logged
 
Lee Critchlow
Newbies
*
Offline



Posts: 8
TN
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #5 - Aug 11th, 2022 at 11:29pm
 
Added setup with Serial.begin(115200); and loop (Release).
multiple definition of __vector_23 is gone, however 25 & 26 still exist. Cry
Back to top
 
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11537
United Kingdom
Re: Arduino IDE compiles and uploads, vMicro has compile errors
Reply #6 - Aug 11th, 2022 at 11:41pm
 
That means the library redefines the timer used by serial which is the default debug mechanism for visual micro. Visual Micro can use software serial for most boards which might use different or no timers.

I don't know if the Serial1,2 etc ports of the mega use different interrupts or timers. If they do then the debugger than use those instead of Serial.

If the library presents a special serial object that implements the same methods and properties that the arduino serial object implements then we can also use that for debugging.

If your board supports hardware debugging that might also be an option.

Does this help?
Back to top
« Last Edit: Aug 12th, 2022 at 12:45am by Tim@Visual Micro »  

Tim Leek
home
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11537
United Kingdom
Re: Serial does not work with the grbl library
Reply #7 - Aug 12th, 2022 at 8:48pm
 
Hi, you just sent a log? I think we have established that in release mode the compile is fine but when serial or the serial debugger is used the project can not b compiled. This is by design by the author of the grbl library. The possible solutions to support debugging are outlined in my previous post.

When time allows, we will investigate the library to see if we can make other recommendations but you can also post a question to the library author to ask for recommendations to make Serial or a type of Serial work alongside the library
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11537
United Kingdom
Re: Serial does not work with the grbl library
Reply #8 - Aug 13th, 2022 at 12:30am
 
We have looked at the "grbl-Mega-edge" library and it is not designed for users to add any arduino code in the normal way. It overrides the arduino main.cpp with its own main.c. The entire running of the mcu is controlled via the main.c in the library itself.

Without modifying the library the only debug capability would be via hardware debugging which the 2560 does support.  Hardware debugging will alter the cpu speed and I suspect that would cause an issue with the grbl code.

The library does include some debug facity which reports useful information via it's own serial system. Take a look at the config.h in the library itself for the setting that the library supports.

In Visual Micro click "vMicro>Show/Hide Hidden Files" to more easily see the sources within the grbl library.

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Lee Critchlow
Newbies
*
Offline



Posts: 8
TN
Re: Serial does not work with the grbl library
Reply #9 - Sep 18th, 2022 at 6:04pm
 
Would it be correct if I created a grbl.ino file and placed the setup portion of main.c into setup and the protocol.c into loop? I ask since trying to add components to grbl has not been successful. Adding those components to setup and loop should work. Undecided
Back to top
 
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline



Posts: 11537
United Kingdom
Re: Serial does not work with the grbl library
Reply #10 - Sep 18th, 2022 at 9:28pm
 
Visual Micro uses Arduino compatible solutions. These are questions that should be directed a the author of the library.
Back to top
 

Tim Leek
home
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print