platform-atmelmegaavr icon indicating copy to clipboard operation
platform-atmelmegaavr copied to clipboard

Natively support pymcuprogram

Open maxgerhardt opened this issue 4 years ago • 6 comments

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.

maxgerhardt avatar Oct 30 '21 23:10 maxgerhardt

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

https://github.com/avrdudes/avrdude

MCUdude avatar Jan 05 '22 22:01 MCUdude

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

matou78 avatar May 11 '22 14:05 matou78

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.

MCUdude avatar May 11 '22 16:05 MCUdude

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

matou78 avatar May 11 '22 16:05 matou78

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).

mairas avatar Jan 31 '23 15:01 mairas

for me all good and sexy :) image

matou78 avatar Feb 03 '23 08:02 matou78