Program ATtiny85 with PlatformIO/VScode on Fedora

I’m trying to setup PlatformIO/VSC on Fedora to program an ATtiny85.

This is my initial platformio.ini

[env:digispark-tiny]
platform = atmelavr
board = digispark-tiny
framework = arduino
upload_protocol = micronucleus

and I’m trying to upload a simple blink sketch

#include <Arduino.h>

void setup() {
  // put your setup code here, to run once:
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

The code compiles but doesn’t upload; message

avrdude: Can't find programmer id "micronucleus"

Valid programmers are: ...

micronucleus is not listed as a valid programmer option.

I googled avrdude: Can't find programmer id "micronucleus"

[env:digispark-tiny]
platform = atmelavr
board = digispark-tiny
framework = arduino
platform_packages = platformio/tool-micronucleus@^1.250.210222 (from https://registry.platformio.org/tools/platformio/tool-micronucleus/installation)
upload_protocol = micronucleus

however I still get the same message

avrdude: Can't find programmer id "micronucleus"

Valid programmers are: ...

Where do I go wrong here?

Hm, the problem is that it shouldn’t be invoking avrdude at all. Also the default upload_protocol is already micronucleus.

Also this is already the default version that will end up selected with the expression

What happens when you only set

[env:digispark-tiny]
platform = atmelavr
board = digispark-tiny
framework = arduino

?

Removing those two statements fixed it and the sketch gets uploaded. Thanks.

Trying to understand this, the [env:digispark-tiny] selects the correspondig json file (digispark-tiny.json) which then specifies micronucleus as the protocol. While largely irrelevant as it now works it still begs the question why it invoked avrdudewith my original [env] defition.

But thanks anyway

This is indeed weird. The code for micronucleus should still trigger.