Examples

Note

A full list with project examples can be found in PlatformIO Repository.

  1. Atmel AVR: Arduino UNO board with auto pre-configured board_* and upload_* options (use only board option) and Arduino Wiring-based Framework

[env:atmelavr_arduino_uno_board]
platform = atmelavr
framework = arduino
board = uno

; enable auto-uploading
targets = upload
  1. Atmel AVR: Embedded board that is based on ATmega168 MCU with “arduino” bootloader

[env:atmelavr_atmega168_board]
platform = atmelavr
board_build.mcu = atmega168
board_build.f_cpu = 16000000L

upload_port = /dev/ttyUSB0
; for Windows OS
; upload_port = COM3
upload_protocol = arduino
upload_speed = 19200

; enable auto-uploading
targets = upload
  1. Upload firmware via USB programmer (USBasp) to Atmel AVR microcontrollers

[env:atmelavr_usbasp]
platform = atmelavr
framework = arduino
board = pro8MHzatmega328
upload_protocol = usbasp
; each flag in a new line
upload_flags =
  -Pusb
  -B5

Then upload firmware using target program for platformio run --target. command. To use other programmers see Upload using Programmer.

  1. ST STM32: Upload firmware using GDB script upload.gdb, issue #175

[env:st_via_gdb]
platform = ststm32
board = armstrap_eagle512
upload_protocol = gdb

Also, take a look at this article Armstrap Eagle and PlatformIO.

  1. ST STM32: Upload firmware using ST-Link instead mbed’s media disk

[env:stlink_for_mbed]
platform = ststm32
board = disco_f100rb
upload_protocol = stlink