platformio / platform-atmelmegaavr

Atmel megaAVR: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/atmelmegaavr
Apache License 2.0
29 stars 22 forks source link

Natively support pymcuprogram #32

Open maxgerhardt opened 3 years ago

maxgerhardt commented 3 years ago

The microchip-pic-avr-tools/pymcuprog tool has emerged and per https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/pypi.md#serial-port-updi-pyupdi is capable of uploading to a MegaAVR device via UPDI via a serial adapter, in the same way pyupdi can.

One might think integrating PyUPDI should be done, but as of 3 days a deprecation notice was posted pointing to the pymcuprog program as its successor. The serialupdi subfolder is PyUPDI slightly adapted.

As of now, PlatformIO only supported PyUPDI via upload_protocol = custom configurations anyways, not natively (see here).

Programming "raw" MegaAVR chips via a simple serial adapter is a common use-case for hobbyists bying the chips directly (such as the convienent DIP form the ATMega4809) and as such, PlatformIO should support uploading the firmware and setting fuses natively through using only a serial adapter and the new pymcuprog program.

For CLI docuentation, see https://github.com/microchip-pic-avr-tools/pymcuprog/issues/7 and https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/pypi.md.

MCUdude commented 2 years ago

The next release of Avrdude will natively support SerialUPDI. It has already been pushed to the upstream repo.

https://github.com/avrdudes/avrdude

matou78 commented 2 years ago

just tested https://github.com/avrdudes/avrdude/releases/tag/v7.0 by replacing "avrdude.exe" and "avrdude.conf" inside of ".platformio\packages\tool-avrdude-megaavr" ( i'm using an AVR64DA32 ) and was able to use "upload_protocol = serialupdi" My updi uploader is a simple ch340

but as i'm such a noob x) no clue how to propose the update lol

MCUdude commented 2 years ago

The Arduino developers will soon build their own Avrdude 7.0 binaries where all the necessary drivers are bunded in the binary. These are probably the binaries PlatformIO should bundle with their platform-atmelavr and platform-atmelmegaavr packages.

matou78 commented 2 years ago

thanks for information, for now it works :p it even helped me find new things for my problem on AVRxxDx chips :)

mairas commented 1 year ago

Avrdude 7.0 and 7.1 are indeed out and work reliably with serialupdi programmers. IMHO, this issue can be closed (and #46 should be fixed).

matou78 commented 1 year ago

for me all good and sexy :) image