MEGA Arduino IDE

Started by JohnO, August 11, 2014, 06:26:03 AM

JohnO

I have a MEGA on order and had a look at setting up the Arduino IDE to accomodate the new hardware. I am running Win7 and am having problems seeing the MonteinoMEGA board type from my tools\board menu. Initially I tried with Arduino 1.5.4r2 and now with 1.5.7 BETA but still now joy.
I am extracting the MonteinoMEGA.zip file into a directory called "MonteinoMEGA" which is within the "hardware" folder in my sketch path.
"My Documents\MEGA\hardware\MonteinoMEGA\cores" is an example path into the directory. I have used MEGA as my sketch path in the Arduino preferences since I also use Tiny which also needs similar provision. I am selecting which to use Tiny or MEGA using the Arduino preferences "Sketchbook location".

I am able to see the "Monteino MEGA (1K DualOptiboot)" option if I extend the path it is stored at to MEGA\hardware\MonteinoMEGA\avr\core" as an example path. But on doing this the most basic of scripts fail to compile with the error below:

===========
Third-party platform.txt does not define compiler.path. Please report this to the third-party hardware maintainer.

processing.app.debug.RunnerException
   at processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:597)
   at processing.app.debug.Compiler.compileFiles(Compiler.java:275)
   at processing.app.debug.Compiler.compileSketch(Compiler.java:642)
   at processing.app.debug.Compiler.compile(Compiler.java:125)
   at processing.app.Sketch.build(Sketch.java:1589)
   at processing.app.Sketch.build(Sketch.java:1509)
   at processing.app.Editor$DefaultRunHandler.run(Editor.java:1915)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
   at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:97)
   at processing.app.helpers.StringReplacer.replaceFromMapping(StringReplacer.java:89)
   at processing.app.helpers.StringReplacer.formatAndSplit(StringReplacer.java:37)
   at processing.app.debug.Compiler.getCommandCompilerCPP(Compiler.java:595)
   ... 7 more
===========

I will have a hack about to create a platform.txt file.

JohnO

Using platform.txt from my ATTiny directory gets a little further but gives up at:
=====
C:\Users\John\AppData\Local\Temp\build6969836744113337559.tmp\WString.cpp.o
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp: In member function 'String& String::copy(const __FlashStringHelper*, unsigned int)':
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:189:26: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
  strcpy_P(buffer, (const prog_char *)pstr);
                          ^
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:189:26: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:189:20: error: expected primary-expression before 'const'
  strcpy_P(buffer, (const prog_char *)pstr);
                    ^
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:189:20: error: expected ')' before 'const'
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp: In member function 'String& String::operator=(const __FlashStringHelper*)':
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:249:39: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
  if (pstr) copy(pstr, strlen_P((const prog_char *)pstr));
                                       ^
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:249:39: error: ISO C++ forbids declaration of 'type name' with no type [-fpermissive]
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:249:33: error: expected primary-expression before 'const'
  if (pstr) copy(pstr, strlen_P((const prog_char *)pstr));
                                 ^
C:\Mega\hardware\MonteinoMEGA\avr\cores\MoteinoMEGA\WString.cpp:249:33: error: expected ')' before 'const'
=====

Felix

John,
I guess I did not try with those 1.5 versions since they are not at a stable release. Could you try with 1.0.5 and see if you get the same thing?
Basically that distribution was modified/added on to from here: http://www.leonardomiliani.com/en/2014/atmega644p1284p-nuovo-core-per-lide-1-5-7-di-arduino/
That was written for 1.5.7 apparently and it should work as long as you install the core in the right place.

In the folder where you have your sketches you should have two special folders: LIBRARIES and HARDWARE. Copy the content of the ZIP under HARDWARE/MoteinoMEGA.
I see some mispelling in the name of your path, not sure if that makes a difference: it should be MoteinoMEGA not MonteinoMEGA.
I would expect your path to have Arduino in it somewhere but it starts with MEGA: C:\Mega\hardware\...
Anyway try 1.0.5 first and see if that works, if so then there might be an issue.

JohnO

Thanks for the swift response Felix. I have corrected the spelling error, still fails in 1.5.x however it works as you decribed when using Arduino 1.0.5. I moved my Mega\ directory to the root of my C:\ drive because "My Documents" we being mapped as "Documents" inside the Arduino preferences for sketchbook location - so I decided on an absolute path.

Felix

I tried 1.5.6 in the meantime and I get some java errors.
The documentation states that it was tested on stable V1.0.5: https://github.com/LowPowerLab/Moteino/tree/master/MEGA/Core

evh


Felix -

My Arduino folder in Documents has a "libraries" folder, but no "hardware folder".  Do I just make one?

Felix


syrinxtech

I am also using Win7 with IDE 1.6.5.

Inside my "sketches" folder I only have a "libraries" folder.  My hardware folder is actually in:

C:\Program Files\Arduino\hardware

Inside of the "hardware" folder is a "Moteino" folder.  This contains a folder named "avr" with the proper files inside.  When I look at the boards option on the IDE I see "Moteino" and "MoteinoMEGA".

I also have an "attiny" and "arduino" folder inside the "hardware" folder that provides access to those boards.

Hope this helps.