[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3 SerialUPDI programmer

SerialUPDI programmer can be used for programming UPDI-only devices using very simple serial connection. You can read more about the details here https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md

SerialUPDI programmer has been tested using FT232RL USB->UART interface with the following connection layout (copied from Spence Kohde’s page linked above):

--------------------                                 To Target device
                DTR|                                  __________________
                Rx |--------------,------------------| UPDI---\/\/---------->
  Tx---/\/\/\---Tx |-------|<|---'          .--------| Gnd    470 ohm 
    resistor    Vcc|---------------------------------| Vcc
        1k      CTS|                     .`          |__________________
                Gnd|--------------------' 
--------------------

There are several limitations in current SerialUPDI/AVRDUDE integration, listed below.

At the end of each run there are fuse values being presented to the user. For most of the UPDI-enabled devices these definitions (low fuse, high fuse, extended fuse) have no meaning whatsoever, as they have been simply replaced by array of fuses: fuse0..9. Therefore you can simply ignore this particular line of AVRDUDE output.

Currently available devices support only UPDI NVM programming model 0 and 2, but there is also experimental implementation of model 3 - not yet tested.

One of the core AVRDUDE features is verification of the connection by reading device signature prior to any operation, but this operation is not possible on UPDI locked devices. Therefore, to be able to connect to such a device, you have to provide ‘-F’ to override this check.

Please note: using ‘-F’ during write operation to locked device will force chip erase. Use carefully.

Another issue you might notice is slow performance of EEPROM writing using SerialUPDI for AVR Dx devices. This can be addressed by changing avrdude.conf section for this device - changing EEPROM page size to 0x20 (instead of default 1), like so:

#------------------------------------------------------------
# AVR128DB28
#------------------------------------------------------------

part parent    ".avrdx"
    id        = "avr128db28";
    desc      = "AVR128DB28";
    signature = 0x1E 0x97 0x0E;

    memory "flash"
        size      = 0x20000;
        offset    = 0x800000;
        page_size = 0x200;
        readsize  = 0x100;
    ;

    memory "eeprom"
        size      = 0x200;
        offset    = 0x1400;
        page_size = 0x1;
        readsize  = 0x100;
    ;
;

USERROW memory has not been defined for new devices except for experimental addition for AVR128DB28. The point of USERROW is to provide ability to write configuration details to already locked device and currently SerialUPDI interface supports this feature, but it hasn’t been tested on wide variety of chips. Treat this as something experimental at this point. Please note: on locked devices it’s not possible to read back USERROW contents when written, so the automatic verification will most likely fail and to prevent error messages, use ‘-V’.

Please note that SerialUPDI interface is pretty new and some issues are to be expected. In case you run into them, please make sure to run the intended command with debug output enabled (‘-v -v -v’) and provide this verbose output with your bug report. You can also try to perform the same action using pymcuprog (https://github.com/microchip-pic-avr-tools/pymcuprog) utility with ‘-v debug’ and provide its output too. You will notice that both outputs are pretty similar, and this was implemented like that on purpose - it was supposed to make analysis of UPDI protocol quirks easier.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on July 19, 2023 using texi2html 5.0.