avrdudes / avrdude

AVRDUDE is a utility to program AVR microcontrollers
GNU General Public License v2.0
696 stars 136 forks source link

jtagice3_tpi programmers not supported by Avrdude #822

Closed MCUdude closed 1 year ago

MCUdude commented 2 years ago

I have an old Xplained Nano ATtiny104 lying around, and to my surprise, I can't use the onboard mEDBG to program the target. This is because JTAG3 programmers in TPI mode has never been added, which means that neither the Pickit4, SNAP or the Atmel ICE can't be used to program TPI compatible AVRs.

Here's a relevant Avrfreaks discussion where @janegilruud has the same conclusion: https://www.avrfreaks.net/forum/need-help-using-attiny104-xplained-nano-mac

I did a quick look, and it seems TPI support is missing for all Atmel/Microchip tools, so that needs to be added. When that is done there will probably be a new type called "jtagice3_tpi", but for now that is missing so it won't help adding it to avrdude.conf.

Here's a discussion I found in a mailing list: https://www.mail-archive.com/avrdude-dev@nongnu.org/msg04906.html

dl8dtl commented 2 years ago

Agreed, nobody ever wrote code for that.

MCUdude commented 2 years ago

AFAIK, this is the public information Microchip provides regarding the jtag3 protocol and how TPI is implemented. From my understanding, TPI support has to be implemented through the stk500v2 protocol, similar to how ISP is already implemented on the jtag3.

https://onlinedocs.microchip.com/pr/GUID-33422CDF-8B41-417C-9C31-E4521ADAE9B4-en-US-2/index.html

dl8dtl commented 2 years ago

From my understanding, TPI support has to be implemented through the stk500v2 protocol, similar to how ISP is already implemented on the jtag3.

This seems correct to me.

The AVRISPmkII already correctly handles that. Inside stk500v2.c, this is called xprog as that's the PDI protocol name on the STK600 (which first implemented PDI) was dubbed. TPI is handled similarly.

MCUdude commented 2 years ago

I stumbled across this document. I'll leave it here so I don't loose it. Might come in handy if I or someone else are going to give this a go some time:

http://ww1.microchip.com/downloads/en/DeviceDoc/50002630A.pdf

dl8dtl commented 2 years ago

Good. I guess it's basically the same what we have in the EDBG subdirectory of our atmel-docs, but back then, they only provided it as HTML.

cederom commented 2 years ago

I just got my hands on ATtiny104XNANO in order to program ATtiny10.. and noticed that TPI is not available :-)

Do you know it FT2232 or xplainedpro driver supports TPI? I also have some of those boards around :-)

cederom commented 2 years ago

Update: I made TPI work with ATtiny10 on FT2232H based interface, see https://github.com/avrdudes/avrdude/issues/928 :-)

MCUdude commented 2 years ago

@janegilruud could it be that you might happen to have tile to look into this issue? I've really tried to come up with a solution several times, but every time I've given up after spending several evenings.

I've tried to look at the jtag3.c and stk500v2.c source code to see how the very similar jtagice3_isp is handled. However, the EDBG documentation is somewhat limited when it comes to the TPI documentation and how the programmer is initialized to speak TPI instead of the ISP, JTAG, PDI, dW, or UPDI.

All I know is that we'll have to call stk600_setup_xprog() after the programmer has been set up to speak TPI

For instance, in the documentation under section 7.4, all devices except TPI ones are mentioned.

Bottom line: I don't think I'm able to proceed without the help from someone more knowledgeable than me. Thanks!

janegilruud commented 2 years ago

I've been a little preoccupied these last few days, but I'll find some time and take a look.

MCUdude commented 2 years ago

@janegilruud that would be great, thank you! Please let me know if there's anything I can do to help. I have an Attiny10 and an Attiny104 I can test with, and I own a PK4, a SNAP and an ATtiny104 Xplained Nano board.

mcuee commented 1 year ago

@janegilruud

Just wondering if we have some updates here.

MCUdude commented 1 year ago

A few weeks ago, Pymcuprog and Pyedbglib were updated to support more targets (thanks @xedbg!). Now we have preliminary support for TPI devices through the JTAG3/EDBG protocol. This is precisely what we'd like to replicate here.

I spent a few hours last night trying to replicate how pymcuprog initializes the programmer, but I didn't succeed. The obstacle I couldn't get across was that jtag3_getsync() in stk500v2.c returns -1 no matter what I do.

mcuee commented 1 year ago

Just a guess, what if you skip that check?

MCUdude commented 1 year ago

It appears that the check is needed. I tried to comment this out, but then it fails further down the line.

xedbg commented 1 year ago

Which error message comes out (from down in the stack) at the point of failure? Edit: If you are using the mEDBG with TPI on that Xplained Nano... then the same 'rules' should apply as when using the Xplained Mini, since they are quite closely related...

MCUdude commented 1 year ago

@xedbg I just updated the Xplained Mini ATtiny104 to the latest FW Studio 7 has to offer (1.07 IIRC).

I've pushed my test branch here: https://github.com/MCUdude/avrdude/tree/jtag3-tpi

Here's the output I'm getting when I leave jtag3_getsync() in there:

$ ./avrdude -cxplainedmini -pattiny104 -v

avrdude: Version 7.0-20220508
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : xplainedmini
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_edbg_recv(): no response available
stk500v2_jtag3_open() rv: -1
avrdude stk500v2_jtag3_open() error: unable to sync with the JTAGICE3 in ISP mode
avrdude main() error: unable to open programmer xplainedmini on port usb

avrdude done.  Thank you.

Here's the output when I'm bypassing it altogether:

$ ./avrdude -cxplainedmini -pattiny104 -v

avrdude: Version 7.0-20220508
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : xplainedmini
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny104
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
           lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
           flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00

         Programmer Type : JTAG3_ISP
         Description     : Atmel AVR XplainedMini in ISP mode
avrdude: jtag3_edbg_recv(): no response available
avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive

avrdude: stk500v2_jtag3_initialize() start
avrdude: jtag3_edbg_recv(): no response available
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 200kHz
        - use -F to override this check

avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive
avrdude: jtag3_edbg_recv(): no response available
avrdude: jtag3_edbg_recv(): no response available

avrdude done.  Thank you.

I've added #define SCOPE_AVR_TPI 0x14 to jtag3_private.h, but I'm not familiar enough with the protocol to properly initialize the programmer for TPI use.

MCUdude commented 1 year ago

So it fails very early in the process. stk500v2_jtag3_open() is the where the connection is established, so it fails before anything is set up properly. Maybe the issue is in jtag3_open_common()?

mcuee commented 1 year ago

I just got the ATtiny104 Xplained Nano from Mouser Singapore (along with some other boards and chips).

The following is the output from git main.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude -cxplainedmini -pattiny104 -v

avrdude: Version 7.0-20221101 (4c92030)
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.conf

         Using Port                    : usb
         Using Programmer              : xplainedmini
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny104
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
           lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
           flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00

         Programmer Type : JTAG3_ISP
         Description     : Atmel AVR XplainedMini in ISP mode
         Vtarget         : 5.00 V
avrdude: jtag3_edbg_recv(): no response available
avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive

avrdude stk500v2_jtag3_initialize() error: part ATtiny104 has no ISP interface
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 200kHz
        - use -F to override this check

avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive
avrdude: jtag3_edbg_recv(): no response available
avrdude: jtag3_edbg_recv(): no response available

avrdude done.  Thank you.

With @MCUdude's test branch.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_tpi_jtag3 -cxplainedmini -pattiny104 -vv

avrdude_tpi_jtag3: Version 7.0-20221109 (c0ec6a5)
                   Copyright (c) Brian Dean, http://www.bdmicro.com/
                   Copyright (c) Joerg Wunsch

                   System wide configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.conf

                   Using Port                    : usb
                   Using Programmer              : xplainedmini
avrdude_tpi_jtag3: stk500v2_jtag3_open()
avrdude_tpi_jtag3: found CMSIS-DAP compliant device, using EDBG protocol
avrdude_tpi_jtag3: sending sign-on command: 0x80 (3 bytes msg)
                   AVR Part                      : ATtiny104
                   RESET disposition             : dedicated
                   RETRY pulse                   : SCK
                   Serial program mode           : yes
                   Parallel program mode         : yes
                   Memory Detail                 :

                                                     Block Poll               Page                       Polled
                     Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                     ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                     fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
                     lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
                     signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
                     calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
                     flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00

                   Programmer Type : JTAG3_ISP
                   Description     : Atmel AVR XplainedMini in ISP mode
avrdude_tpi_jtag3: jtag3_getparm()
avrdude_tpi_jtag3: sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
                   Vtarget         : 5.00 V
avrdude_tpi_jtag3: jtag3_getparm()
avrdude_tpi_jtag3: sending get parameter (scope 0x12, section 1, parm 32) command: avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available

avrdude_tpi_jtag3: get parameter (scope 0x12, section 1, parm 32) command: timeout/error communicating with programmer (status -1)
avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available
avrdude_tpi_jtag3 stk500v2_jtag3_recv() error: unable to receive

avrdude_tpi_jtag3: stk500v2_jtag3_initialize() start
avrdude_tpi_jtag3: jtag3_setparm()
avrdude_tpi_jtag3: sending set parameter (scope 0x12, section 0, parm 0) command: avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available

avrdude_tpi_jtag3: set parameter (scope 0x12, section 0, parm 0) command: timeout/error communicating with programmer (status -1)
avrdude_tpi_jtag3 main() error: initialization failed, rc=-1
                  - double check the connections and try again
                  - use -B to set lower ISP clock frequency, e.g. -B 200kHz
                  - use -F to override this check

avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available
avrdude_tpi_jtag3 stk500v2_jtag3_recv() error: unable to receive
avrdude_tpi_jtag3: stk500v2_jtag3_close()
avrdude_tpi_jtag3: jtag3_close()
avrdude_tpi_jtag3: sending AVR sign-off command: avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available

avrdude_tpi_jtag3: AVR sign-off command: timeout/error communicating with programmer (status -1)
avrdude_tpi_jtag3: sending sign-off command: avrdude_tpi_jtag3: jtag3_edbg_recv(): no response available

avrdude_tpi_jtag3: sign-off command: timeout/error communicating with programmer (status -1)

avrdude_tpi_jtag3 done.  Thank you.

pymcuprog works fine.

(py39x64venv) PS C:\work\avr\pymcuprog> pymcuprog read -f t104_readback.hex
Connecting to anything possible
Connected to mEDBG CMSIS-DAP from Atmel (serial number ATMLxxx)
Debugger firmware version 1.7.10
Debugger hardware revision 0
Device mounted: 'attiny104'
No device specified.  Using on-board target (attiny104)
pymcuprog.nvm - WARNING -
pymcuprog.nvm - WARNING - AVR-TPI stack is in Alpha state
pymcuprog.nvm - WARNING - Expect some features to be missing
pymcuprog.nvm - WARNING -
Pinging device...
Ping response: 1E900B
Reading...
Data written to hex file: 't104_readback.hex'
Done.
xedbg commented 1 year ago

For a start, this output here: get parameter (scope 0x12, section 1, parm 32) indicates that it is attempting to read the "mega programming clock" - this is not relevant to TPI and will probably return FAILURE_NOT_SUPPORTED

MCUdude commented 1 year ago

@xedbg thanks for the hint! I'll look into it as soon as the kids are in bed.

It would be amazing if we could resolve this before Avrdude 7.1 gets released (right before Christmas I think)! I'll try my best to make it happen

MCUdude commented 1 year ago

For a start, this output here: get parameter (scope 0x12, section 1, parm 32)

This comes from the jtag3_print_parms1() function (in jtag3.c) where Avrdude attempts to print various information read from the programmer.

@xedbg I've pushed a few commits that comments out code that's causing invalid responses.

This is the output now:

$ ./avrdude -cxplainedmini -pattiny104 -vv

avrdude: Version 7.0-20220508
         Copyright (c) Brian Dean, http://www.bdmicro.com/
         Copyright (c) Joerg Wunsch

         System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
         User configuration file is /Users/hans/.avrduderc

         Using Port                    : usb
         Using Programmer              : xplainedmini
avrdude: stk500v2_jtag3_open()
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny104
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
           lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
           flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00

         Programmer Type : JTAG3_ISP
         Description     : Atmel AVR XplainedMini in ISP mode
avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive

avrdude: stk500v2_jtag3_initialize() start
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 0) command: avrdude: jtag3_edbg_recv(): no response available

avrdude: set parameter (scope 0x12, section 0, parm 0) command: timeout/error communicating with programmer (status -1)
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 200kHz
        - use -F to override this check

avrdude: jtag3_edbg_recv(): no response available
avrdude stk500v2_jtag3_recv() error: unable to receive
avrdude: stk500v2_jtag3_close()
avrdude: jtag3_close()
avrdude: sending AVR sign-off command: avrdude: jtag3_edbg_recv(): no response available

avrdude: AVR sign-off command: timeout/error communicating with programmer (status -1)
avrdude: sending sign-off command: avrdude: jtag3_edbg_recv(): no response available

avrdude: sign-off command: timeout/error communicating with programmer (status -1)

avrdude done.  Thank you.

However, the next part is to figure out how to set up stk500v2_jtag3_initialize() properly. This is how it currently looks, but it only works for AVRs with ISP. The commands probably has to be way different.

https://github.com/MCUdude/avrdude/blob/9cdeffdecb57c29e9e70d87b6bafdc9ee18d8968/src/stk500v2.c#L1274-L1353

xedbg commented 1 year ago

Yes, indeed :/ There are housekeeping calls which need to be made on the general-purpose debuggers, but many of those are optional on the mEDBG on kits. So working with a Xplained kit should make for a simpler start. But the bulk of the work needs to be done on the TPI protocol envelope (0x14) level. There are only a handful of config parameters (https://github.com/microchip-pic-avr-tools/pyedbglib/blob/main/pyedbglib/protocols/tpiprotocol.py#L63) and there are defaults in place for the Xplained kit, so those are also optional I realise the pymcuprog stub code only reads out the device ID, but it does so using a memory read (https://github.com/microchip-pic-avr-tools/pymcuprog/blob/eda95bdcc4a4cb4e4f442aa59a2d49c423dfd730/pymcuprog/nvmtpi.py#L37).

MCUdude commented 1 year ago

It seems like the Xplainedmini TPI becomes unresponsive (instead of returning -1) when it receives a call/command that it doesn't recognize. The Xplainedmini ISP isn't like this, is it?

In order to match the messages sent in pymcuprog/pyedbglib, it seems like I can't use jtag3_setparm(), since this carries too much data, but instead use jtag3_command(). But this is again different than what's done to initialize the other JTAG3 interfaces (ISP, JTAG, PDI, UPDI)

xedbg commented 1 year ago

Well, technically these are three separate protocols in parallel: ISP on 0x11, TPI on 0x14 and all-the-rest on 0x12... so something is fishy in there, probably as a result of the onions of protocols stacked up here :| A set to (0x12, 0, 0) is really only relevant to operations in 0x12, not TPI on 0x14. The standalone debuggers arguably will be ok with this regardless, but the mEDBG was stripped down to aggressively to fit in that the host really unfortunately has to know that it (in this case) is a TPI medbg instance, which needs only housekeeping and TPI functionality (so nothing on 0x11 or 0x14). 32k flash has its limitations... (specially while someone is holding one's beer). To find this out, it should really use the DISCOVERY QUERY call for a command_handler list, and see which one it contains...

janegilruud commented 1 year ago

Created PR #1205

MCUdude commented 1 year ago

1205 is now merged! 🎉

cederom commented 1 year ago

WOW! CONGRATZ! I WILL TAKE A LOOK IN A FREE MOMENT :-)

when a release? :-)

MCUdude commented 1 year ago

when a release? :-)

Avrdude v7.1 will probably be released by the end of December

cederom commented 1 year ago

Initial testing results with today git pull main:

% uname -a
FreeBSD octagon 13.1-STABLE FreeBSD 13.1-STABLE #1 stable/13-n253256-09072186eec1: Fri Dec  9 22:47:42 CET 2022     root@octagon:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

% git log -5 --oneline
159d126 (HEAD -> main, origin/main, origin/HEAD) Update NEWS
95363a1 Terminal read improvements (#1209)
bbd3ed2 Merge pull request #1208 from stefanrueger/urclock-updi
b108546 Consider libedit only in interactive mode (#1207)
72f0975 Merge pull request #1206 from stefanrueger/nsafety

Cannot get to terminal on AtTiny104 XplainedNano:

% ./avrdude -c xplainedmini_tpi -p t104 -vv -t

avrdude: Version 7.0-20221214 (159d126)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /XXX/avrdude.git/build_freebsd/src/avrdude.conf
         User configuration file is /XXX/.avrduderc
avrdude yywarning() warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

         Using Port                    : usb
         Using Programmer              : xplainedmini_tpi
avrdude: jtag3_open_tpi()
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny104
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
           lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
           flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00
           sigrow                  0     0     0    0 no         16   16      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_TPI
         Description     : Atmel AVR XplainedMini in TPI mode
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE HW version  : 0
         ICE FW version  : 1.07 (rel. 10)
         Serial number   : ATML2678020200009059
avrdude: jtag3_enable_tpi() is empty. No action necessary.
avrdude: jtag3_initialize_tpi() start
avrdude jtag3_command_tpi() error: [TPI] command Enter Progmode FAILED! Status: 0x03
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 200kHz
        - use -F to override this check

avrdude jtag3_command_tpi() error: [TPI] command Leave Progmode FAILED! Status: 0x01
avrdude: jtag3_close_tpi() is empty. No action necessary.

avrdude done.  Thank you.

Cannot get to terminal on AtTiny416 XplainedNano:

% ./avrdude -c xplainedmini_tpi -p t416 -vv -t

avrdude: Version 7.0-20221214 (159d126)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /XXX/avrdude.git/build_freebsd/src/avrdude.conf
         User configuration file is /XXX/.avrduderc
avrdude yywarning() warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

         Using Port                    : usb
         Using Programmer              : xplainedmini_tpi
avrdude: jtag3_open_tpi()
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny416
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse4       tcd0cfg     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7       append      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8       bootend     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuses                   0     0     0    0 no          9   10      0     0     0 0x00 0x00
           lock                    0     0     0    0 no          1    1      0     0     0 0x00 0x00
           tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig                 0     0     0    0 no         61   61      0     0     0 0x00 0x00
           sernum                  0     0     0    0 no         10    1      0     0     0 0x00 0x00
           osccal16                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osccal20                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc16err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc20err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
           userrow     usersig     0     0     0    0 no         32   32      0     0     0 0x00 0x00
           eeprom                  0     0     0    0 no        128   32      0     0     0 0x00 0x00
           flash                   0     0     0    0 no       4096   64      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_TPI
         Description     : Atmel AVR XplainedMini in TPI mode
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE HW version  : 0
         ICE FW version  : 1.13 (rel. 43)
         Serial number   : ATML2795042700003537
avrdude: jtag3_enable_tpi() is empty. No action necessary.
avrdude: jtag3_initialize_tpi() start
avrdude: jtag3_edbg_recv(): no response available
avrdude jtag3_recv_tpi() error: jtag3_recv_tpi(): unable to receive

avrdude: TPI Enter Progmode command: timeout/error communicating with programmer (status -1)
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower ISP clock frequency, e.g. -B 200kHz
        - use -F to override this check

avrdude: jtag3_edbg_recv(): no response available
avrdude jtag3_recv_tpi() error: jtag3_recv_tpi(): unable to receive

avrdude: TPI Leave Progmode command: timeout/error communicating with programmer (status -1)
avrdude: jtag3_close_tpi() is empty. No action necessary.

avrdude done.  Thank you.

Any hints welcome :-)

janegilruud commented 1 year ago

ATtiny416 uses UPDI, not TPI. Wrong interface.

mcuee commented 1 year ago

No issues here under a FreeBSD VM. I did not set up the proper USB permission so that I have to use sudo.

mcuee@freebsdx64vm:~/build $ git clone https://github.com/avrdudes/avrdude.git
Cloning into 'avrdude'...
remote: Enumerating objects: 14847, done.
remote: Counting objects: 100% (753/753), done.
remote: Compressing objects: 100% (312/312), done.
remote: Total 14847 (delta 523), reused 646 (delta 437), pack-reused 14094
Receiving objects: 100% (14847/14847), 7.98 MiB | 12.82 MiB/s, done.
Resolving deltas: 100% (10402/10402), done.

mcuee@freebsdx64vm:~/build $ cd avrdude

mcuee@freebsdx64vm:~/build/avrdude $ ./build.sh 
-- The C compiler identification is Clang 11.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/local/bin/git (found version "2.35.2") 
-- Found FLEX: /usr/bin/flex (found version "2.6.4") 
-- Found YACC: /usr/bin/yacc
-- Looking for libelf.h
-- Looking for libelf.h - found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - not found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - not found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DON'T HAVE libftdi
-- DO HAVE    libftdi1
-- DO HAVE    libreadline
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mcuee/build/avrdude/build_freebsd
[  1%] Generating avrdude.conf
[  1%] Built target conf
[  3%] [FLEX][Parser] Building scanner with flex 2.6.4
[  4%] [YACC][Parser] Building parser with yacc
[  6%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  9%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[ 10%] Building C object src/CMakeFiles/libavrdude.dir/avrcache.c.o
[ 12%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
[ 13%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.o
[ 15%] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.o
[ 16%] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.o
[ 18%] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.o
[ 19%] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.o
[ 21%] Building C object src/CMakeFiles/libavrdude.dir/config.c.o
[ 22%] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.o
[ 24%] Building C object src/CMakeFiles/libavrdude.dir/crc16.c.o
[ 25%] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.o
[ 27%] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.o
[ 28%] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.o
[ 30%] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.o
[ 31%] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.o
[ 33%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.o
[ 34%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.o
[ 36%] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.o
[ 37%] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.o
[ 39%] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.o
[ 40%] Building C object src/CMakeFiles/libavrdude.dir/lists.c.o
[ 42%] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.o
[ 43%] Building C object src/CMakeFiles/libavrdude.dir/par.c.o
[ 45%] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.o
[ 46%] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.o
[ 48%] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.o
[ 50%] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.o
[ 51%] Building C object src/CMakeFiles/libavrdude.dir/ppi.c.o
[ 53%] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.o
[ 54%] Building C object src/CMakeFiles/libavrdude.dir/serbb_posix.c.o
[ 56%] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.o
[ 57%] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.o
[ 59%] Building C object src/CMakeFiles/libavrdude.dir/ser_posix.c.o
[ 60%] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.o
[ 62%] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.o
[ 63%] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.o
[ 65%] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.o
[ 66%] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.o
[ 68%] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.o
[ 69%] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.o
[ 71%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.o
[ 72%] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.o
[ 74%] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.o
[ 75%] Building C object src/CMakeFiles/libavrdude.dir/urclock.c.o
[ 77%] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.o
[ 78%] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.o
[ 80%] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.o
[ 81%] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.o
[ 83%] Building C object src/CMakeFiles/libavrdude.dir/update.c.o
[ 84%] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.o
[ 86%] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.o
[ 87%] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.o
[ 89%] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.o
[ 90%] Linking C static library libavrdude.a
[ 90%] Built target libavrdude
[ 92%] Building C object src/CMakeFiles/avrdude.dir/main.c.o
[ 93%] Building C object src/CMakeFiles/avrdude.dir/term.c.o
[ 95%] Building C object src/CMakeFiles/avrdude.dir/avrintel.c.o
[ 96%] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.o
[ 98%] Building C object src/CMakeFiles/avrdude.dir/whereami.c.o
[100%] Linking C executable avrdude
[100%] Built target avrdude

Build succeeded.

Run

sudo cmake --build build_freebsd --target install

to install.

mcuee@freebsdx64vm:~/build/avrdude $ sudo cmake --build build_freebsd --target install
Password:
[  1%] Built target conf
Consolidate compiler generated dependencies of target libavrdude
[ 90%] Built target libavrdude
Consolidate compiler generated dependencies of target avrdude
[100%] Built target avrdude
Install the project...
-- Install configuration: "RelWithDebInfo"
-- Installing: /usr/local/bin/avrdude
-- Installing: /usr/local/lib/libavrdude.a
-- Installing: /usr/local/include/libavrdude.h
-- Installing: /usr/local/etc/avrdude.conf
-- Installing: /usr/local/man/man1/avrdude.1

mcuee@freebsdx64vm:~/build/avrdude $ cd build_freebsd/src/

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ ls
CMakeFiles      avrdude         avrdude.spec
Makefile        avrdude.conf        cmake_install.cmake
ac_cfg.h        avrdude.conf.in     libavrdude.a

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ ./avrdude -c xplainedmini_tpi -p t104 -vv -t

avrdude: Version 7.0-20221214 (159d126)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /usr/home/mcuee/build/avrdude/build_freebsd/src/avrdude.conf
         User configuration file is /home/mcuee/.avrduderc
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : xplainedmini_tpi
avrdude: jtag3_open_tpi()
avrdude usbhid_open() warning: USB device with VID: 0x03eb and PID: 0x2145 not found
avrdude jtag3_open_common() error: did not find any device matching VID 0x03eb and PID list: 0x2145
avrdude main() error: unable to open programmer xplainedmini_tpi on port usb

avrdude done.  Thank you.

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ sudo ./avrdude -c xplainedmini_tpi -p t104 -vv -t

avrdude: Version 7.0-20221214 (159d126)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /usr/home/mcuee/build/avrdude/build_freebsd/src/avrdude.conf
         User configuration file is /root/.avrduderc
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : xplainedmini_tpi
avrdude: jtag3_open_tpi()
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny104
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse                    0     0     4    0 no          1   16      0     0     0 0x00 0x00
           lockbits                0     0     0    0 no          1   16      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3   16      0     0     0 0x00 0x00
           calibration             0     0     0    0 no          1   16      0     0     0 0x00 0x00
           flash                   0     0   128    0 no       1024   16      0     0     0 0x00 0x00
           sigrow                  0     0     0    0 no         16   16      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_TPI
         Description     : Atmel AVR XplainedMini in TPI mode
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE HW version  : 0
         ICE FW version  : 1.07 (rel. 10)
         Serial number   : ATMLxxxxxxxxxxxxxxxxx
avrdude: jtag3_enable_tpi() is empty. No action necessary.
avrdude: jtag3_initialize_tpi() start
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
Vtarget         : 5.00 V
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00 s 
avrdude: jtag3_read_byte_tpi(.., signature, 0x0, ...)

avrdude: jtag3_read_byte_tpi(.., signature, 0x1, ...)
Reading | #################                                  | 33% 0.04 s 
avrdude: jtag3_read_byte_tpi(.., signature, 0x2, ...)
Reading | ################################################## | 100% 0.06 s 

avrdude: device signature = 0x1e900b (probably t104)
avrdude> quit
avrdude: jtag3_close_tpi() is empty. No action necessary.

avrdude done.  Thank you.

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ sudo ./avrdude -c xplainedmini_tpi -p t104  -qqt
avrdude> dump fuse
0000  ff                                                |.               |

avrdude> dump lockbits
0000  ff                                                |.               |

avrdude> dump signature
0000  1e 90 0b                                          |..              |

avrdude> dump flash 0 0x40
0000  aa 55 aa ff ff ff ff ff  ff ff ff ff ff ff ff ff  |.U..............|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

avrdude> write flash 0 0x40 0x55 ...
avrdude> flush
avrdude> dump flash 0 0x40
0000  55 55 55 55 55 55 55 55  55 55 55 55 55 55 55 55  |UUUUUUUUUUUUUUUU|
0010  55 55 55 55 55 55 55 55  55 55 55 55 55 55 55 55  |UUUUUUUUUUUUUUUU|
0020  55 55 55 55 55 55 55 55  55 55 55 55 55 55 55 55  |UUUUUUUUUUUUUUUU|
0030  55 55 55 55 55 55 55 55  55 55 55 55 55 55 55 55  |UUUUUUUUUUUUUUUU|

avrdude> quit

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ ldd avrdude
avrdude:
    libm.so.5 => /lib/libm.so.5 (0x800304000)
    libelf.so.2 => /lib/libelf.so.2 (0x800337000)
    libusb.so.3 => /usr/lib/libusb.so.3 (0x800353000)
    libhidapi.so.0 => /usr/local/lib/libhidapi.so.0 (0x80036c000)
    libftdi1.so.2 => /usr/local/lib/libftdi1.so.2 (0x800377000)
    libreadline.so.8 => /usr/local/lib/libreadline.so.8 (0x800388000)
    libc.so.7 => /lib/libc.so.7 (0x8003e2000)
    libthr.so.3 => /lib/libthr.so.3 (0x8007f3000)
    libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x800820000)
    libncursesw.so.9 => /lib/libncursesw.so.9 (0x80091f000)

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ uname -a
FreeBSD freebsdx64vm 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: 
Fri Apr  9 04:24:09 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64
mcuee commented 1 year ago

@cederom

As mentioned by other reply, you have to use UPDI for ATtiny416. The following is with the ATtiny416-XNANO Kit right out of the box (newly bought).

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ sudo ./avrdude -c xplainedmini_updi -p t416 -t
Password:

         Vtarget                      : 5.00 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9221 (probably t416)
avrdude> dump fuses

Reading | ################################################## | 100% 0.15 s 

0000  00 00 02 ff 00 f4 07 00  00                       |.........       |

avrdude> quit
avrdude> 
avrdude done.  Thank you.

mcuee@freebsdx64vm:~/build/avrdude/build_freebsd/src $ sudo ./avrdude -c xplainedmini_updi -p t416
 -U flash:r:factory_t416_xnano_readback.hex:i

         Vtarget                      : 5.00 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9221 (probably t416)
avrdude: reading flash memory ...

Reading | ################################################## | 100% 1.67 s 

avrdude: writing output file factory_t416_xnano_readback.hex

avrdude done.  Thank you.
cederom commented 1 year ago

Sorry for my bad interface selection :-) True 416 works fine in UPDI :-) Congratz and Thank You! :-)

% ./avrdude -c xplainedmini_updi -p t416 -vv -t

avrdude: Version 7.0-20221214 (159d126)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is /XXX/avrdude.git/build_freebsd/src/avrdude.conf
         User configuration file is /XXX/.avrduderc
avrdude yywarning() warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

         Using Port                    : usb
         Using Programmer              : xplainedmini_updi
avrdude: jtag3_open_updi()
avrdude: HV UPDI support: 1
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
avrdude: sending sign-on command: 0x80 (3 bytes msg)
         AVR Part                      : ATtiny416
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse4       tcd0cfg     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7       append      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8       bootend     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuses                   0     0     0    0 no          9   10      0     0     0 0x00 0x00
           lock                    0     0     0    0 no          1    1      0     0     0 0x00 0x00
           tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig                 0     0     0    0 no         61   61      0     0     0 0x00 0x00
           sernum                  0     0     0    0 no         10    1      0     0     0 0x00 0x00
           osccal16                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osccal20                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc16err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc20err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
           userrow     usersig     0     0     0    0 no         32   32      0     0     0 0x00 0x00
           eeprom                  0     0     0    0 no        128   32      0     0     0 0x00 0x00
           flash                   0     0     0    0 no       4096   64      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_UPDI
         Description     : Atmel AVR XplainedMini in UPDI mode
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9 bytes msg)
avrdude: sending get info (serial number) command: 0x81 (23 bytes msg)
         ICE HW version  : 0
         ICE FW version  : 1.13 (rel. 43)
         Serial number   : ATML2795042700003537
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 1) command: 0x84 (6 bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 0) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 1) command: 0x80 (3 bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 1, parm 0) command: 0x80 (3 bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6 bytes msg)
         Vtarget         : 5.00 V
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 32) command: 0x84 (6 bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 33) command: 0x84 (6 bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 48) command: 0x84 (6 bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 49) command: 0x84 (6 bytes msg)
UPDI SET:
        xd->prog_base_msb=0
        xd->prog_base=0 80
        xd->flash_page_size_msb=0
        xd->flash_page_size=40
        xd->eeprom_page_size=20
        xd->nvmctrl=0 10
        xd->ocd=80 f
        xd->address_mode=0
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 2, parm 0) command: 0x80 (3 bytes msg)
avrdude: sending AVR sign-on command: 0x84 (8 bytes msg)
avrdude: partial Family_ID returned: "tiny"
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00 s avrdude: jtag3_read_byte(.., signature, 0x0, ...)
          mapped to address: 0x1100
avrdude: sending enter progmode command: 0x80 (3 bytes msg)
avrdude: sending read memory command: 0x84 (7 bytes msg)
avrdude: jtag3_read_byte(.., signature, 0x1, ...)
          mapped to address: 0x1101
Reading | #################                                  | 33% 0.10 s avrdude: jtag3_read_byte(.., signature, 0x2, ...)
          mapped to address: 0x1102
Reading | ################################################## | 100% 0.10 s

avrdude: device signature = 0x1e9221 (probably t416)
avrdude> dump flash 0 1024

Reading |                                                    | 0% 0.00 s avrdude: jtag3_paged_load(.., flash, 64, 0x0000, 64)
Reading | -------------------------------------------------- | 0% 10.00 s

avrdude usbhid_recv() error: short read, read only 0 out of 64 bytes
avrdude: jtag3_edbg_send(): unexpected response 0x01, 0x00
0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0040, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0080, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x00c0, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0100, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0140, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0180, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x01c0, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0200, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0240, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0280, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x02c0, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0300, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0340, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x0380, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
avrdude: jtag3_paged_load(.., flash, 64, 0x03c0, 64)
avrdude: sending read memory command: 0x84 (68 bytes msg)
0000  37 c0 53 c0 52 c0 51 c0  50 c0 4f c0 4e c0 4d c0  |7.S.R.Q.P.O.N.M.|
0010  4c c0 4b c0 4a c0 49 c0  48 c0 47 c0 46 c0 45 c0  |L.K.J.I.H.G.F.E.|
0020  44 c0 43 c0 42 c0 41 c0  40 c0 3f c0 3e c0 3d c0  |D.C.B.A.@.?.>.=.|
0030  3c c0 3b c0 75 6e 69 71  75 65 00 63 68 69 70 69  |<.;.unique.chipi|
0040  64 00 63 68 69 70 72 65  76 00 6f 6b 00 6c 65 64  |d.chiprev.ok.led|
0050  20 6f 66 66 00 6c 65 64  20 6f 6e 00 6e 61 6b 00  | off.led on.nak.|
0060  67 6f 6f 64 20 64 61 79  00 68 65 6c 6c 6f 00 00  |good day.hello..|
0070  11 24 1f be cf ef cd bf  df e3 de bf 1e e3 a0 e0  |.$..............|
0080  be e3 e0 ea f3 e0 02 c0  05 90 0d 92 a4 31 b1 07  |.......... ..1..|
0090  d9 f7 2e e3 a4 e1 be e3  01 c0 1d 92 a1 32 b2 07  |.............2..|
00a0  e1 f7 0e 94 ba 01 0c 94  ce 01 0c 94 00 00 e0 e0  |...... ... .....|
00b0  f2 e0 81 81 81 60 81 83  e0 e0 f4 e0 82 e0 81 83  |.....`..........|
00c0  84 e0 82 83 e0 e0 f8 e0  80 e2 81 87 8d e8 80 87  |................|
00d0  83 e0 87 83 80 ec 86 83  87 e1 9e e3 80 93 15 3e  |...............>|
00e0  90 93 16 3e 08 95 e0 e0  f8 e0 94 81 95 ff fd cf  |...>............|
00f0  80 93 02 08 08 95 cf 93  df 93 ec 01 88 81 88 23  |...............#|
0100  31 f0 21 96 0e 94 73 00  89 91 81 11 fb cf 8d e0  |1.!...s.........|
0110  0e 94 73 00 8a e0 0e 94  73 00 df 91 cf 91 08 95  |..s.....s.......|
0120  cf 93 df 93 ec 01 fc 01  84 91 88 23 49 f0 fe 01  |...........#I...|
0130  21 96 84 91 0e 94 73 00  fe 01 84 91 81 11 f7 cf  |!.....s.........|
0140  8d e0 0e 94 73 00 8a e0  0e 94 73 00 df 91 cf 91  |....s.....s.....|
0150  08 95 fc 01 90 91 04 08  99 23 2c f4 80 91 00 08  |.........#,.....|
0160  80 83 81 e0 08 95 80 e0  08 95 cf 93 df 93 1f 92  |................|
0170  cd b7 de b7 ce 01 01 96  0e 94 a9 00 88 23 51 f1  |.............#Q.|
0180  80 91 14 3e 8f 5f 80 93  14 3e 8b 30 40 f0 87 e1  |...>._...>.0@...|
0190  9e e3 80 93 15 3e 90 93  16 3e 10 92 14 3e 89 81  |.....>...>...>..|
01a0  8d 30 21 f0 8a 30 11 f0  81 11 07 c0 e0 91 15 3e  |.0!..0.........>|
01b0  f0 91 16 3e 10 82 81 e0  0d c0 e0 91 15 3e f0 91  |...>.... ....>..|
01c0  16 3e 9f 01 2f 5f 3f 4f  20 93 15 3e 30 93 16 3e  |.>../_?O ..>0..>|
01d0  80 83 80 e0 0f 90 df 91  cf 91 08 95 cf 93 c8 2f  |.............../|
01e0  e8 2f e2 95 ef 70 f0 e0  ee 5f f1 4c 80 81 0e 94  |./...p..._.L....|
01f0  73 00 cf 70 ec 2f f0 e0  ee 5f f1 4c 80 81 0e 94  |s..p./..._.L....|
0200  73 00 cf 91 08 95 9b 01  2f 5f 3f 4f fb 01 64 91  |s......./_?O..d.|
0210  dc 01 11 96 fc 01 80 81  68 13 0b c0 66 23 59 f0  |........h. .f#Y.|
0220  f9 01 84 91 9d 91 89 13  08 c0 88 23 41 f0 31 96  |...........#A.1.|
0230  f8 cf 80 e0 08 95 81 e0  08 95 80 e0 08 95 81 e0  |................|
0240  08 95 69 e6 70 e0 87 e1  9e e3 0e 94 03 01 88 23  |..i.p..........#|
0250  29 f0 80 e6 90 e0 0e 94  90 00 83 c0 65 e5 70 e0  |)...........e.p.|
0260  87 e1 9e e3 0e 94 03 01  88 23 41 f0 80 e2 80 93  |.........#A.....|
0270  26 04 8a e4 90 e0 0e 94  90 00 73 c0 6d e4 70 e0  |&.........s.m.p.|
0280  87 e1 9e e3 0e 94 03 01  88 23 41 f0 80 e2 80 93  |.........#A.....|
0290  25 04 8a e4 90 e0 0e 94  90 00 63 c0 62 e4 70 e0  |%.........c.b.p.|
02a0  87 e1 9e e3 0e 94 03 01  88 23 49 f0 80 91 01 0f  |.........#I.....|
02b0  0e 94 ee 00 80 e0 9e e3  0e 94 7b 00 52 c0 6b e3  |..........{.R.k.|
02c0  70 e0 87 e1 9e e3 0e 94  03 01 88 23 89 f0 80 91  |p..........#....|
02d0  00 11 0e 94 ee 00 80 91  01 11 0e 94 ee 00 80 91  |................|
02e0  02 11 0e 94 ee 00 80 e0  9e e3 0e 94 7b 00 39 c0  |............{.9.|
02f0  64 e3 70 e0 87 e1 9e e3  0e 94 03 01 88 23 69 f1  |d.p..........#i.|
0300  80 91 03 11 0e 94 ee 00  80 91 04 11 0e 94 ee 00  |................|
0310  80 91 05 11 0e 94 ee 00  80 91 06 11 0e 94 ee 00  |................|
0320  80 91 07 11 0e 94 ee 00  80 91 08 11 0e 94 ee 00  |................|
0330  80 91 09 11 0e 94 ee 00  80 91 0a 11 0e 94 ee 00  |.. ....... .....|
0340  80 91 0b 11 0e 94 ee 00  80 91 0c 11 0e 94 ee 00  |.. ....... .....|
0350  80 e0 9e e3 0e 94 7b 00  04 c0 8c e5 90 e0 0e 94  |......{.........|
0360  90 00 87 e1 9e e3 80 93  15 3e 90 93 16 3e 10 92  |.........>...>..|
0370  14 3e 08 95 88 ed 84 bf  10 92 61 00 e0 e0 f4 e0  |.>........a.....|
0380  80 e2 85 a3 81 a3 80 e1  82 a3 0e 94 57 00 0e 94  |............W...|
0390  b5 00 88 23 e1 f3 0e 94  21 01 f9 cf f8 94 ff cf  |...#....!.......|
03a0  00 00 30 31 32 33 34 35  36 37 38 39 41 42 43 44  |..0123456789ABCD|
03b0  45 46 00 00 ff ff ff ff  ff ff ff ff ff ff ff ff  |EF..............|
03c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
cederom commented 1 year ago

Mystery solved with AtTiny104@XplainedNano, turns out I did remove three 1k resistors between interface and target chip to play with FTDI programming and I forgot to solder them again, no wonder it did not work heh, when these programming resistors are back all works fine! THANK YOU AND CONGRATULATIONS!!! :-)

% ./avrdude -c xplainedmini_tpi -p t104 -t
avrdude warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

Vtarget                      : 5.00 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e900b (probably t104)
avrdude> dump flash 0 1024

Reading | -------------------------------------------------- | 0% 10.00 s

avrdude error: short read, read only 0 out of 64 bytes
0000  0f c0 1e c0 1d c0 1c c0  1b c0 1a c0 19 c0 18 c0  |................|
0010  17 c0 16 c0 15 c0 14 c0  13 c0 12 c0 11 c0 10 c0  |................|
0020  11 27 1f bf cf e5 d0 e0  de bf cd bf 20 e0 a0 e4  |.'.......... ...|
0030  b0 e0 01 c0 1d 93 aa 34  b2 07 e1 f7 4a d0 5c c0  |.......4....J.\.|
0040  df cf 44 e0 45 b9 1a b9  43 e3 49 b9 48 e1 4d b9  |..D.E...C.I.H.M.|
0050  4e e0 4c b9 42 e4 50 e0  e0 e4 f0 e0 41 93 50 83  |N.L.B.P.....A.P.|
0060  08 95 75 9b fe cf 88 b9  08 95 cf 93 c8 2f 80 e3  |..u........../..|
0070  f8 df 88 e7 f6 df 8c 2f  82 95 8f 70 8a 30 18 f0  |......./...p.0..|
0080  89 5c ef df 02 c0 80 5d  ec df 8c 2f 8f 70 8a 30  |.\.....].../.p.0|
0090  18 f0 89 5c e6 df 02 c0  80 5d e3 df 8d e0 e1 df  |...\.....]......|
00a0  8a e0 df df cf 91 08 95  81 17 91 07 69 f4 08 95  |............i...|
00b0  00 00 00 00 00 00 00 00  41 50 51 0b c9 f7 00 00  |........APQ ....|
00c0  81 50 91 0b 19 f4 08 95  77 ee 63 e0 47 2f 56 2f  |.P. ....w.c.G/V/|
00d0  ef cf 48 ed 4c bf 16 bf  45 e7 49 bf 0d 9a 39 9a  |..H.L...E.I. .9.|
00e0  31 9a af df 80 e0 c1 e0  c8 0f bf df 05 9a 88 ee  |1...............|
00f0  93 e0 da df 8c 2f f7 cf  f8 94 ff cf ff ff ff ff  |...../..........|
0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0120  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0130  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0140  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0150  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0160  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0170  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0180  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0190  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0200  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0210  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0220  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0230  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0240  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0250  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0260  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0270  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0280  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0290  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0300  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0310  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0320  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0330  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0340  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0350  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0360  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0370  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0380  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0390  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

avrdude> erase flash
erasing chip ...
avrdude error: short read, read only 0 out of 64 bytes

avrdude> dump flash 0 1024

Reading | ################################################## | 100% 0.00 s

0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0050  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0060  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0070  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0080  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0090  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0100  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0110  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0120  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0130  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0140  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0150  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0160  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0170  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0180  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0190  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
01f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0200  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0210  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0220  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0230  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0240  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0250  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0260  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0270  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0280  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0290  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
02f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0300  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0310  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0320  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0330  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0340  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0350  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0360  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0370  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0380  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0390  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03b0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03c0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03d0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03e0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
03f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

^C

% ./avrdude -c xplainedmini_tpi -p t104 -U flash:w:cederom.bin:r
avrdude warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

Vtarget                      : 5.00 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e900b (probably t104)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file cederom.bin for flash
         with 1024 bytes in 1 section within [0, 0x3ff]
         using 64 pages and 0 pad bytes
avrdude: writing 1024 bytes flash ...

Writing | ################################################## | 100% 14.10 s

avrdude: 1024 bytes of flash written
avrdude: verifying flash memory against cederom.bin

Reading | ################################################## | 100% 3.65 s

avrdude: 1024 bytes of flash verified

avrdude done.  Thank you.

% ./avrdude -c xplainedmini_tpi -p t104 -t
avrdude warning: programmer ktlink overwrites previous definition /XXX/avrdude.git/build_freebsd/src/avrdude.conf:758. [/XXX/.avrduderc:376]

Vtarget                      : 5.00 V
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e900b (probably t104)
avrdude> dump flash 0 1024

Reading | ################################################## | 100% 3.65 s

0000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0040  00 00 00 00 00 00 00 00  00 00 00 00 43 65 44 65  |............CeDe|
0050  52 4f 4d 00 57 55 5a 00  48 45 52 45 00 00 00 00  |ROM.WUZ.HERE....|
0060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0090  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0100  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0120  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0130  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0140  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0150  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0160  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0170  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0180  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0190  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
01f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0210  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0240  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0260  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0270  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0290  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
02f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0300  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0310  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0320  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0330  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0340  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0350  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0360  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0370  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0380  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
0390  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03d0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03e0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
03f0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

I noticed that after leaving terminal mode I had to reconnect the board in order to flash etc but that is not a big problem. Thank you folks YOU ROX!! :-)