Installing Moteino core in Arduino IDE 1.5x

Started by Robert, February 04, 2015, 10:24:57 AM

Felix

This is only needed for MoteinoMEGAs. For regular Moteinos use ArduinoUNO target.

TomWS

Quote from: Robert on February 12, 2015, 02:54:30 AM
The solution is:

Arduino 1.5x  Moteino/MoteinoMEGA Arduino core files for Atmega328P/ATmega1284P based Moteinos.

New Arduino 1.5x structure: see # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

Sketch
      /hardware
                    /Moteino
                               /avr
                                    board.txt
                                    platform.txt
                                    programmers.txt
                                    /bootloaders
                                                     /Moteino
                                                                /DualOptiboot_V5.0_atmega328_BlinkD9.hex
                                                    /MoteinoMEGA
                                                                /DualOptiboot_V5.0_atmega1284p_BlinkD9.hex
                                   /variants
                                               /MoteinoMEGA
                                                                    /pins_arduino.h
                                           
So practically the modify the current files (see https:https://github.com/LowPowerLab/Moteino/tree/master/MEGA/Core).

1. By rearranging the ones of IDE 1.0x to the hierarchy structure of 1.5x (see above)
2. Slightly adapt the board.txt by adding "Moteino.upload.tool=avrdude" which is missing
3. Create a platform.txt file, which is a copy of the standard arduino one but renamed as "Moteino AVR Boards"
4. Create a empty programmers.txt file
or
install the attached ZIP file

NB:

1. I did test it with IDE 1.57 and 1.58 with the verify and upload functions ONLY (NOT with the programmer tool)
2. If IDE 1.0x and IDE 1.5x are to be used; a double hardware description is necessary (the old one and the new one) for instance as:
Sketch
      /hardware
               /Moteino10
                          .... old 1.0x
Sketch
      /hardware
               /Moteino15
                          ... new 1.5x

Robert
Robert, thanks for putting together the zip file, this made it very easy to setup.  A couple of comments, however:

  • The  folder is misspelled as 'Motineo15', rather than 'Moteino15' - a minor point but may 'bite' you later on.  Also, the '15' in unnecessary unless you also use the 1.0.6 IDE. (which you do mention, but I thought I'd highlight here).
  • With the included files, the IDE gives a build warning that '...doesn't define a 'build.board' preference'.  This is easily corrected by adding two lines to the boards.txt file.  The Moteino section gets: Moteino.build.board=AVR_MOTEINO  and the MoteinoMEGA section gets: MoteinoMEGA.build.board=AVR_MOTEINOMEGA
As I said, this was very helpful and relieved most of the trepidation I had about adding a new development tool to my system.

THANKS!
Tom

Tomega3

Hi, I followed the suggestions and the 2 changes to the boards.txt file recomended by TomWS for installing the zip file on a Windows XP pc and using Arduino IDE 1.6.2.
I installed the zip file contents with the fixes inside my sketch folder:
C:\Documents and Settings\TomE\My Documents\Arduino\hardware\Moteino15\avr

I installed Arduino 1.6.2 in C:\Program|file\Arduino
but the Hardware folder within only has a Tools folder that has an exe called listCommPorts.exe


I try to compile the Gateway example sketch and the compiler reports:

Arduino: 1.6.2 (Windows XP), Board: "MoteinoMEGA"

Build options changed, rebuilding all

Using library RFM69 in folder: C:\Documents and Settings\TomE\My Documents\Arduino\libraries\RFM69 (legacy)

Using library SPI in folder: C:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.3\libraries\SPI

Using library SPIFlash in folder: C:\Documents and Settings\TomE\My Documents\Arduino\libraries\SPIFlash (legacy)



C:\Program Files\Arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega1284p -DF_CPU=16000000L -DARDUINO=10602 -DARDUINO_AVR_MOTEINOMEGA -DARDUINO_ARCH_AVR -IC:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.3\cores\arduino -IC:\Documents and Settings\TomE\My Documents\Arduino\hardware\Moteino15\avr\variants\MoteinoMEGA -IC:\Documents and Settings\TomE\My Documents\Arduino\libraries\RFM69 -IC:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.3\libraries\SPI -IC:\Documents and Settings\TomE\My Documents\Arduino\libraries\SPIFlash C:\DOCUME~1\TomE\LOCALS~1\Temp\build1613667701493250845.tmp\Gateway.cpp -o C:\DOCUME~1\TomE\LOCALS~1\Temp\build1613667701493250845.tmp\Gateway.cpp.o

Cannot run program "C:\Program Files\Arduino/hardware/tools/avr/bin/avr-g++": CreateProcess error=3, The system cannot find the path specified

Can anyone help me track down the solution to this?
Do I need to create an AVR and SAM folder within the in C:\Program|file\Arduino\Hardware folder and install the moteino mega core files within it?

Arduino 1.0.6 with Motenio Cores works fine. I had some free time and decided to try Arduino IDe 1.6.x,
Sometimes I wonder if the old saying is true, if it aint broke - don't fix it;
but would like to try the SPITransactions feature in the 1.6.x ide and lib with the rfm69 radio and some other spi devices on the bus.

Thanks

Tomega3

After some head scratching and googling it appears Ardiono IDE 1.6.2 changed where the hardware/avr/boards.txt and Variants files live.

I have successfully used Arduino IDE 1.6.2 with the MoteinoMega core files to load the example Gateway.ino sketch on a MoteinoMega and the Node.ino example sketch on a USB Moteino R4 using the UNO as the slected board.

I am using Windows XP
The trick with arduino ide 1.6.2 is to find this folder on you pc:
C:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.3

Yours may be:
C:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.2  if you have not clicked on the the Tools -> Board Manager -> Arduini AVR Boards by Arduino UPDATE button.

Assuming you have found this folder you should see:
boards.txt
platform.txt
programmers.txt
variants Folder
libraries Folder
firmwares Folder
cores Folder
bootloaders Folder

To add the MoteinoMega 'board' to arduino ide 1.6.2
1. copy the MoteinoMega section of the boards.txt file that Felix provides on his github site
to clipboard.
2. Open the boards.txt file found in your version of:
C:\Documents and Settings\TomE\Application Data\Arduino15\packages\arduino\hardware\avr\1.6.3
3. paste the MoteinoMega section at the bottom of the arduino ide 1.6.2 boards.txt files and save it. (I made a backup of the original before doing this, you may want to too)

4. Copy the MoteinoMega folder from Felix's variants folder and paste it into the arduino ide 1.6.2 variants folder

That's it.

I think to install the MoteinoMega and Moteino dualoptiboot booltloaders some tweaking needs to be done inside the arduino ide 1.6.2 bootloaders folder.

Hope this helps others.



kobuki

Lots of useful info in this thread. The 1.0x IDE is very old. I'd assume that most people use 1.5 or 1.6 nowadays (including myself as well), and they really should since many improvements are added to the newer Arduino library base as well since the old version, even for 328-based parts.

@Felix: could this thread be made a sticky?

Felix

Actually I personally find 1.6+ annoying and while some things are fixed, some things are damaged and very annoying. So I am using 1.0.6 on a daily basis. But I have to support 1.6.1 since the core I released is targeted to that version. The instructions on the moteino page are very clear how to install the core so I will leave this topic as is for now.

kobuki

Well, I can see the Moteino page is reorganised and there's some indirect info on how to integrate your stuff into the 1.6 IDE. I also prefer more advanced IDEs for more serious development but I had to realise that if I want easy access for any of my open source code on the Arduino family, I better support the latest official IDE. So at least I compile and run from there at least once and only give away code that's fine on that.