I'm trying to compile marlin dev firmware from
https://github.com/MarlinFirmware/MarlinDev.
I had no trouble getting earlier versions to compile in Visual Micro, but dev version is heavily using 3rd party board definitions introduced with Arduino 1.5 platform and they seem to disagree with VM.
Developers provide couple of custom boards (here
https://raw.githubusercontent.com/marlinfirmware/MarlinDev/platform/package_marl...) which I added to Arduino IDE Boards Manager Additional URL. They are available in Arduino IDE under Tool->Board menu and I can select any of them and compile firmware for them without problems.
In Visual Micro, all custom boards are visible and I can pick any of them except custom Marlin Arduino Mega boards. When either of two Mega boards is selected, VM changes the selected board to equivalent Arduino/Genuino Mega board. Marlin boards.txt uses prefix "mega" for these boards and when I change it to "mega2", they can be selected from drop down list in Visual Micro.
They're also doing some toolchain tweaking in platform.txt and it seems that VM is not picking it up. In particular (if I'm interpreting this correctly), they define MARLIN flag when calling the compiler (last parameter):
compiler.c.flags=-c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -MMD {build.unique_id_flags} -DMARLIN
compiler.cpp.flags=-c -g -Os {compiler.warning_flags} -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD {build.unique_id_flags}
-DMARLIN This flag is checked in many header files, and compile error is raised when it's missing:
// Sanity check
#ifndef MARLIN
#error Compilation using cores other than those provided in this distribution are unsupported
#endif
It seems that VM is not adding this flag as can be seen from the output:
r-g++" -c -g -Os -w -std=gnu++11 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics
-MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"..." "...\Arduino\libraries\MarlinDev\buzzer.cpp" -o .o"
Am I doing something wrong or is this a bug?
Thanks