platformio / platform-atmelavr

Atmel AVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelavr
Apache License 2.0
136 stars 104 forks source link

KeyError: 'tool-avrdude' : fuses.py cannot find tool-avrdude #269

Closed Madour closed 1 year ago

Madour commented 2 years ago

Hello, I am trying to burn a bootloader to my DigiSpark board (ATTINY85).

When running the following command : platformio.exe run --target bootloader --environment digispark-tiny, I get a KeyError : 'tool-avrdude'

The error comes from _packages.py file the self.packagesmember dictionary does not contain the key "tool-avrdude':

def get_package_spec(self, name, version=None):
        return PackageSpec(
            owner=self.packages[name].get("owner"),
            name=name,
            requirements=version or self.packages[name].get("version"),
        )

Which is called in fuse.py line 479:

        % join(env.PioPlatform().get_package_dir("tool-avrdude") or "", "avrdude.conf"),

I do have a tool-avrdude folder like C:\Users\UserName\.platformio\packages\tool-avrdude

Any help is welcome thanks

MrSurly commented 1 year ago

@Madour: I just came across this problem myself (#306) -- did you ever find a solution?

Madour commented 1 year ago

Unfortunately not. In the end, I gave up as it was not very crucial for my project.

Did you fix the issue, or fond a workaround?

MrSurly commented 1 year ago

pio pkg install -t tool-avrdude solved it for me. Evidently atmelmegaavr hard-codes this value somewhere, and if you're using a chip that doesn't required avrdude, it errors out. Installing the tool fixes that error.