I'm liking the use of upload to also program!

So I was working with a small ATtiny85 project this morning and when I went to program the chip, I saw the following:

norman@hubble:$ pio run -t program
Processing attiny85 (platform: atmelavr; board: attiny85)
--------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
...
Building in release mode
Error: The `program` target is deprecated. To use a programmer for uploading firmware specify custom `upload_command`.
More information: https://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-using-programmer

This is a great change as it means that there is no need to remember (and that’s getting difficult at my age!) two commands when one will do!

Thanks to whoever decided this was a good idea - you were right! :grin:

Cheers,
Norm.

Is there any docs on how to use it?

There is indeed!

If you go here then find your board, there’s usually an “uploading” section for each board where special settiungs in platformio.ini are required.

For my Uno, the board page is here and has no section, so I don;t need any special settings in platformio.ini.

Well, that’s true if I want to use the Arduino bootloader that comes built in to all/most ATmega328 microcontrollers these days.

To upload a sketch, all I have to do in th command line is:

mkdir sketch
cd sketch
pio run --board uno
vi src.main.cpp
## Type my sketch here & save it.

## Compile
pio run 

## Upload
pio run --target upload

However, I like to use my USBTiny ICSP device to program my boards, abnd as such, I need to tell PlatformIo to use it instead of the bootloader, so:

; PlatformIO.ini

upload_protocol = usbtiny

Then it’s:

mkdir sketch
cd sketch
pio run --board uno
vi src.main.cpp
## Type my sketch here & save it.

## Compile
pio run 

## Upload
pio run --target upload

Exactly the same as before. This time, because I specified the upload_protocol PlatformIO uses the USBtiny and not the bootlloader.

What ICSP devices are there? There are details here for numerous devices for all sorts of boards.

HTH

Cheers,
Norm.