Is it possible to use PlatformIO to install Arduino firmware?

Hi all,
I’ve built a SB-Freeduino and couldn’t get any test programs loaded on it. Did a bit of research and troubleshooting and found when I swapped the Atmega328 on the Freeduino with that from a Duemanilove the problem went with the chip. Apparently there’s nothing wrong with the board, it’s just that (I’m pretty sure) the Atmega328 doesn’t have the proper firmware burned on it. I found instructions to use the Arduino IDE to burn the chip but I 'd rather not download and install the Arduino IDE just for that. I’d rather use PlatformIO. I’m using PlatformIO because I am really excited about the idea of being able to use a single IDE for all my different microcontroller projects.

  1. Take a look at Atmel AVR — PlatformIO latest documentation
  2. You can use ~/.platformio/packages/tool-avrdude/avrdude directly from PlatformIO IDE Terminal. See details Installing an Arduino Bootloader.

I was asking myself exactly the same question: how to program an Arduino from PlatformIO using an external programmer, so thank you for this information.

Unfortunately the Atmel ICE programmer, which is now widely used, is not listed. Would it be possible to include it in the next release?

I am attaching the Arduino programmer.txt file that defines the Atmel ICE programmer in case it helps:

# Copyright (c) 2014-2015 Arduino LLC.  All right reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

edbg.name=Atmel EDBG
edbg.communication=USB
edbg.protocol=
edbg.program.protocol=
edbg.program.tool=openocd
edbg.program.extra_params=

atmel_ice.name=Atmel-ICE
atmel_ice.communication=USB
atmel_ice.protocol=
atmel_ice.program.protocol=
atmel_ice.program.tool=openocd
atmel_ice.program.extra_params=

sam_ice.name=Atmel SAM-ICE
sam_ice.communication=USB
sam_ice.protocol=
sam_ice.program.protocol=
sam_ice.program.tool=openocd
sam_ice.program.extra_params=

What is your board? Please go to Arduino IDE settings, enable verbose mode for build and upload operation. Upload firmware using Atmel ICE programmer and Arduino IDE and paste console output to http://pastebin.com. Share it here.

Thanks.

Hi, I took my Arduino M0 Pro (from the Arduino.org organization), and I programmed it succesfully using the Atmel ICE and the Arduino.cc IDE, and these are all the messages log in relation to the Program load:
http://pastebin.com/raw/A64c8MjD

As you probably know the Atmel ICE is able to program Atmel AVR and ATMEL SAMD MCU, so I tried to upload the blink example to a standard Arduino UNO (Atmel AVR), but unfrotunately it does not work, the Arduino.cc IDE does not find the Atmel ICE programmer, maybe because the programmer is only defined in the ICE architecture.

I hope the information helps to have the programmer integrated into PlatformIO. Thanks!!