avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding support for UPDI-over-UART programmers


From: Joerg Wunsch
Subject: Re: Adding support for UPDI-over-UART programmers
Date: Thu, 23 Apr 2020 21:57:39 +0200

As Paul "LeoNerd" Evans wrote:

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

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[]
in pgm_types.c.

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

http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]