Upload using Programmer

To upload firmware using programmer you need to use program target instead upload for platformio run --target command. For example, platformio run -t program.

Warning

Upload options like upload_port don’t work as expected with platformio run -t program. You need to use upload_flags if you want to specify custom port or speed (see examples below).

Note

List of avrdude supported programmers are accessible with avrdude -c ?

Configuration for the programmers:

Upload EEPROM data

To upload EEPROM data (from EEMEM directive) you need to use uploadeep target instead upload for platformio run --target command. For example, platformio run -t uploadeep.

Fuses

PlatformIO has built-in target named fuses for setting fuse bits. The default fuse bits are predefined in board manifest file in fuses section. For example, Arduino Uno Fuses.

To set fuse bits you need to use target fuses for platformio run --target command.

Custom Fuses

You can specify custom fuse bits. Please create custom extra_scripts and override default “fuses” command:

platformio.ini:

[env:custom_fuses]
platform = atmelavr
extra_scripts = extra_script.py

extra_script.py:

Import('env')
env.Replace(FUSESCMD="avrdude $UPLOADERFLAGS -e -Ulock:w:0x3F:m -Uhfuse:w:0xDE:m -Uefuse:w:0x05:m -Ulfuse:w:0xFF:m")

Articles

See more Articles about us.

Examples

All project examples are located in PlatformIO repository Examples for Atmel AVR platform.