Cannot use platformio to upload sketch to attiny85 using arduino as isp (via nano)

Hello,

I’m moving to platformio from arduino ide, and have difficulty to upload sketch to my attiny85 using arduino as isp (via nano). I’ve read all the discussion about this topic but still have no success.

What I did :

  • Successfully upload sketch using arduino ide to attiny using nano via arduino as isp (so no problem here)
  • I create new project with attiny85, so my platformio.ini content below

[env:attiny85]

platform = atmelavr

board = attiny85

framework = arduino

And after some reading, i add new env :

[env:program_via_ArduinoISP]
platform = atmelavr
framework = arduino
board = attiny85
upload_protocol = stk500v1
upload_port = COM4
upload_speed = 115200
upload_flags =
    -C
    $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
    -p
    $BOARD_MCU
    -P
    $UPLOAD_PORT
   -b
    $UPLOAD_SPEED
   -c
    stk500v1
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

But I cannot see the button upload via isp ? And when using upload button - the error said timeout or something

What I did wrong ?

Thanks

Edit : Arduino as ISP sketch already in the nano - because I tried multiple times
switching using arduino ide (work flawlessly) then using platform io - and not working

No, per docs this must be upload_protocol = custom.

No, per docs this must be upload_speed = 19200.

“Upload” is the upload button via the configured upload method, that you configured to be via ISP in the platformio.ini. There is no separate button that does something different.

Thanks for answering, I’ll try your suggestion and come back to you

And now it works, I dont know what I’ve done before, I think I already used that config, here’s what I do to make it works (thanks to @maxgerhardt )

@platformio.ini

[env:program_via_ArduinoISP]
board = attiny85
platform = atmelavr
framework = arduino
upload_protocol = custom
upload_port = COM4
upload_speed = 19200
upload_flags =
    -C
    ; use "tool-avrdude-megaavr" for the atmelmegaavr platform
    $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf
    -p
    $BOARD_MCU
    -P
    $UPLOAD_PORT
    -b
    $UPLOAD_SPEED
    -c
    stk500v1
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

Then project tasks - program_via_ArduinoISP - upload

Case closed