There are several easy hacks to talk UPDI over any standard UART
device. These started with some advice from `pyupdi` about how to
just use a 4k7 resistor on the TX line of any USB-UART bridge to turn
the thing into a half-duplex onewire. I now make and sell two separate
products on my Tindie store[2,3] for doing this and I also link to my
Device::AVR::UPDI CPAN module containing another implementation of
I figure now's about the time for avrdude itself to have an
implementation too, so the standard AVR code-uploading tool can do it.
On Wed, 25 Mar 2020 16:31:16 +0000
"Paul \"LeoNerd\" Evans" <[hidden email]> wrote:
> Would anyone like to have a go at this, based on these two examples?
> Or failing that, give me a hand-hold at how to add new programmer
> support so I can do it?
Anyone any update on this?
I'm just looking for a small amount of handholding, to get me started
on the process. I basically have some questions mostly about how to add
some new programmer type to the codebase.
I am *totally* guessing here I'd go something like
$ git clone SOMEWHERE
$ cd avrdude
$ cp some-example.c prog_updi-uart.c
$ $EDITOR some_main.c
# add in a link to the new programmer type somehow
$ $EDITOR prog_updi-uart.c
# actually implement my code here
Is that a reasonable description? Can anyone help me fill in the
details so I can give you a new programmer type, please?
> I am *totally* guessing here I'd go something like
> $ git clone SOMEWHERE
> $ cd avrdude
> $ cp some-example.c prog_updi-uart.c
> $ $EDITOR some_main.c
> # add in a link to the new programmer type somehow
> $ $EDITOR prog_updi-uart.c
> # actually implement my code here
Unfortunately, I'm afraid nothing like that is readily available.
You could try looking up one of the more simple drivers (i.e. *not*
those for stk500v2 or jtagice etc.) as a reasonable template.
In general, each programmer is described by a table of method it
implements, usually located towards the end of the programmer
pgm_new() in pgm.c mentions all programmer fields, among them, these
are marked "mandatory":
* mandatory functions - these are called without checking to see
* whether they are assigned or not
pgm->initialize = pgm_default_2;
pgm->display = pgm_default_6;
pgm->enable = pgm_default_4;
pgm->disable = pgm_default_4;
pgm->powerup = pgm_default_powerup_powerdown;
pgm->powerdown = pgm_default_powerup_powerdown;
pgm->program_enable = pgm_default_2;
pgm->chip_erase = pgm_default_2;
pgm->open = pgm_default_open;
pgm->close = pgm_default_4;
pgm->read_byte = pgm_default_3;
pgm->write_byte = pgm_default_5;
Finally, your programmer needs to be added to programmer_types
That's it. :-)
OK, life is probably more difficult, but I hope it gets you an initial
idea. Just ask here for more if you're stuck.
Btw., I'm surprised UPDI is looking that simple as you described it.
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL