Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
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....
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
The Marlin project build fails (Arduino compiles Ok) (Read 380 times)
audeo
Newbies
*
Offline



Posts: 5
The Marlin project build fails (Arduino compiles Ok)
Oct 10th, 2019 at 9:01pm
 
I love the tools that Visual Studio has to offer, so I downloaded and installed Visual Micro years ago when I had 2017 still. Now I'm running VS 2019 with the same issues as before. Basically, I am trying to modify and flash Marlin (3d printer firmware) onto an Atmega2560-powered board. It compiles and runs perfectly when flashed from Arduino, but it is super inconvenient to have to switch back and forth between two IDE's. I have no idea why this keeps happening, and has happened for the longest time, but it WILL. NOT. COMPILE. I just get a ton of errors.

Code (C++):
Compiling 'Marlin' for 'ATmega2560 (Mega 2560) (Arduino/Genuino Mega)'

MarlinConfig.h:40: In file included from
Marlin.ino:31: from

SanityCheck.h: 1119:5: error: non-constant condition for static assertion
   static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF)
   ^~~~~~~~~~~~~

fastio.h:50: In file included from
MarlinConfig.h:26: from
Marlin.ino:31: from

fastio_1280.h: 112:21: error: reinterpret_cast from integer to pointer
   #define DIO6_PWM    &OCR4AL
fastio.h:99: note  in expansion of macro DIO6_PWM
   #define _GET_TIMER(IO) (DIO ## IO ## _PWM)
   ^~~
fastio.h:111: note  in expansion of macro _GET_TIMER
   #define GET_TIMER(IO) _GET_TIMER(IO)
   ^~~~~~~~~~
SanityCheck.h:1119: note  in expansion of macro GET_TIMER
   static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF)
   ^~~~~~~~~

MarlinConfig.h:40: In file included from
Marlin.h:36: from
blinkm.cpp:28: from

Error compiling project sources
SanityCheck.h: 1119:5: error: non-constant condition for static assertion
Build failed for project 'Marlin'
   static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF)
   ^~~~~~~~~~~~~

fastio.h:50: In file included from
MarlinConfig.h:26: from
Marlin.h:36: from
blinkm.cpp:28: from

fastio_1280.h: 112:21: error: reinterpret_cast from integer to pointer
   #define DIO6_PWM    &OCR4AL
fastio.h:99: note  in expansion of macro DIO6_PWM
   #define _GET_TIMER(IO) (DIO ## IO ## _PWM)
   ^~~
fastio.h:111: note  in expansion of macro _GET_TIMER
   #define GET_TIMER(IO) _GET_TIMER(IO)
   ^~~~~~~~~~
SanityCheck.h:1119: note  in expansion of macro GET_TIMER
   static_assert(GET_TIMER(E0_AUTO_FAN_PIN), "E0" AF_ERR_SUFF)
   ^~~~~~~~~
 



Yes, I have Arduino IDE 1.6/1.8 selected. Yes, I have the board selected. I feel like I'm missing something, anyone else have this problem?
Back to top
« Last Edit: Oct 11th, 2019 at 4:43pm by Visual Micro »  
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10623
United Kingdom
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #1 - Oct 10th, 2019 at 9:24pm
 
Please give download link for the project and also follow the guide in yellow above so we can ensure we have same tool chain and.or library version(s) to replicate.
Back to top
« Last Edit: Oct 11th, 2019 at 4:44pm by Visual Micro »  
WWW  
IP Logged
 
audeo
Newbies
*
Offline



Posts: 5
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #2 - Oct 10th, 2019 at 11:19pm
 
https://github.com/MakerGear/m3firmware/tree/1.1.6

Please take note of the instructions, you have to uncomment a line in order to activate a printer. The machine I am using is the M3ID Rev1.

Quote:
Before you can compile, you must select your 3D printer configruation by editing the file

Marlin/Configuration_makergear.h

Uncomment one of the #define statements depending on your printer. For example if you have an M3-ID Rev1, find

//Standard M3 ID Rev1 with Probe

// #define MAKERGEAR_MODEL_M3_ID_REV1_000

and replace it with

//Standard M3 ID Rev1 with Probe

#define MAKERGEAR_MODEL_M3_ID_REV1_000


I'll attach the output as a text file.
Back to top
« Last Edit: Oct 11th, 2019 at 4:44pm by Visual Micro »  

Errors_001.txt (158 KB | )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10623
United Kingdom
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #3 - Oct 11th, 2019 at 4:41pm
 
We have looked at this and suspect that if your project builds OK in the arduino ide then you are using a different arduino version than you have assigned to Visual Micro 1.6/1.8

Your project does not build in the recent arduino IDEs, however we found it built okay in Arduino IDE 1.8.2.

In Visual Micro, you do not have to change the IDE that Visual Micro points, that will not help. You just need to switch off the feature that adds a compiler include path for the current project folder. See attached image.

The issue is that in recent Arduino versions the project include path is added autoatmically, this is why it became an option in Visual Micro with the option being enabled by default. The Marlin project uses an spi.h which then confused the lookup for the expected SPI.h library. Windows is not case sensitive and I think the author or the mearlin project is not using windows so missed this fact.







Back to top
« Last Edit: Oct 11th, 2019 at 4:44pm by Visual Micro »  
WWW  
IP Logged
 
audeo
Newbies
*
Offline



Posts: 5
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #4 - Oct 12th, 2019 at 4:12pm
 
Thank you for this insight. Unfortunately this did not fix the problem.

A quick note: I am using Arduino IDE version 1.8.10.

Here is a screenshot of the compiler menu for the VMicro extension after making this change:

...
Back to top
« Last Edit: Oct 12th, 2019 at 4:17pm by audeo »  

Errors_002.txt (111 KB | 3 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10623
United Kingdom
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #5 - Oct 12th, 2019 at 4:23pm
 
Please switch the tool bar from Debug to Relase and click build. The post the output as .txt.

Thanks
Back to top
 
WWW  
IP Logged
 
audeo
Newbies
*
Offline



Posts: 5
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #6 - Oct 12th, 2019 at 4:39pm
 
Update to a previous claim: I actually had updated to Arduino IDE 1.8.10 about a week ago, but I never tested Marlin on it. I get the same issues with Arduino IDE as I do with Visual Micro, that is multiple instances of SPI.h and build errors. Any other advice on fixing this issue?
Back to top
 
 
IP Logged
 
audeo
Newbies
*
Offline



Posts: 5
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #7 - Oct 12th, 2019 at 4:43pm
 
Ran in "Release" mode, same issue.

BIG UPDATE: I uninstalled 1.8.10 and then installed 1.8.0 and now Arduino IDE and VMicro are working.
Back to top
« Last Edit: Oct 12th, 2019 at 4:57pm by audeo »  

Errors_003.txt (111 KB | 2 )
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10623
United Kingdom
Re: The Marlin project build fails (Arduino compiles Ok)
Reply #8 - Oct 12th, 2019 at 5:58pm
 
Thanks for the update that's good to hear. The issue happens when the following is defined.

// #define BLINKM



Back to top
« Last Edit: Oct 12th, 2019 at 5:59pm by Visual Micro »  
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print