ElTangas / jtag2updi

UPDI programmer software for Arduino (targets Tiny AVR-0/1/2, Mega AVR-0 and AVR-DA/DB MCUs)
MIT License
337 stars 90 forks source link

Unable to erase ATtiny402 #53

Closed Frogieder closed 3 years ago

Frogieder commented 3 years ago

I tried to communicate with the ATtiny402 over UPDI, yet I couldn't. My chips are brand new, I bought them from a very reliable seller. The error message I got after I managed to get the programmer working seemed similar to the message I am supposed to get with a locked chip. I tried to unlock it by erasing it using -e flag or by using -F -t flags, yet none of them worked. I was stuck with the same error message. I am sure that my connections are right, I added a 10uF capacitor on my Arduino Uno to prevent it from resetting (which indeed works), I have copied the .conf file, and all the code I'm using is the most recent one I can get to. I am running everything on a Linux machine. There doesn't seem to be anything about this particular problem in other issues, not open nor closed, as far as I can tell. I'd really appreciate if you could look into this. The outputs (both verbose and short) of my commands look like this:

$ avrdude -c jtag2updi -P /dev/ttyACM0 -p t402 -F -t

    avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description
    avrdude: AVR device initialized and ready to accept instructions

    Reading |                                                    | 0% 0.00savrdude: jtagmkII_program_enable(): bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
    avrdude: jtagmkII_program_enable(): bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
    avrdude: jtagmkII_read_byte(): bad response to read memory command: RSP_ILLEGAL_MCU_STATE
    avr_read(): error reading address 0x0000
        read operation not supported for memory "signature"
    avrdude: error reading signature data for part "ATtiny402", rc=-2
    avrdude: error reading signature data, rc=-2
    avrdude: jtagmkII_program_disable(): bad response to leave progmode command: RSP_ILLEGAL_MCU_STATE

    avrdude done.  Thank you.`

$ avrdude -c jtag2updi -P /dev/ttyACM0 -p t402 -F -t -v -v -v -v

avrdude: Version 6.3-20171130
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2014 Joerg Wunsch

        System wide configuration file is "/etc/avrdude.conf"
        User configuration file is "/home/martin/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyACM0
        Using Programmer              : jtag2updi
avrdude: jtagmkII_open_pdi()
avrdude: jtagmkII_getsync()
avrdude: jtagmkII_getsync(): Sending sign-on command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [00] . [00] . [01] . [00] . [00] . [00] . [0e] . [01] . [f3] . [97] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [1d] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [86] . [01] . [01] . [00] . [06] . [01] . [01] . [00] . [06] . [01] . [00] . [00] . [00] . [00] . [00] . [00] J [4a] T [54] A [41] G [47] I [49] C [43] E [45]   [20] m [6d] k [6b] I [49] I [49] . [00] 
avrdude: Recv: < [3c] 
avrdude: Recv: . [7f] 

avrdude: jtagmkII_recv(): Got message seqno 0 (command_sequence == 0)
avrdude: Recv: . [86] . [01] . [01] . [00] . [06] . [01] . [01] . [00] . [06] . [01] . [00] . [00] . [00] . [00] . [00] . [00] J [4a] T [54] A [41] G [47] I [49] C [43] E [45]   [20] m [6d] k [6b] I [49] I [49] . [00] 

Raw message:
0x86 0x01 0x01 0x00 0x06 0x01 0x01 0x00 0x06 0x01 0x00 0x00 0x00 0x00 0x00 0x00
0x4a 0x54 0x41 0x47 0x49 0x43 0x45 0x20 0x6d 0x6b 0x49 0x49 0x00 
Sign-on succeeded

JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
boot-loader FW version:        1
firmware version:              6.00
hardware version:              1
S_MCU:
boot-loader FW version:        1
firmware version:              6.00
hardware version:              1
Serial number:                   00:00:00:00:00:00
Device ID:                       JTAGICE mkII
avrdude: jtagmkII_getsync(): Using a 298-byte device descriptor
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 
avrdude: jtagmkII_send(): sending 3 bytes
avrdude: Send: . [1b] . [01] . [00] . [03] . [00] . [00] . [00] . [0e] . [02] . [03] . [06] $ [24] 1 [31] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [cd] 
avrdude: Recv: . [83] 

avrdude: jtagmkII_recv(): Got message seqno 1 (command_sequence == 1)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: jtagmkII_getsync(): Sending get sync command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [02] . [00] . [01] . [00] . [00] . [00] . [0e] . [0f] . [e2] u [75] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [02] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [1d] 
avrdude: Recv: . [09] 

avrdude: jtagmkII_recv(): Got message seqno 2 (command_sequence == 2)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

        AVR Part                      : ATtiny402
        Chip Erase delay              : 0 us
        PAGEL                         : P00
        BS2                           : P00
        RESET disposition             : dedicated
        RETRY pulse                   : SCK
        serial program mode           : yes
        parallel program mode         : yes
        Timeout                       : 0
        StabDelay                     : 0
        CmdexeDelay                   : 0
        SyncLoops                     : 0
        ByteDelay                     : 0
        PollIndex                     : 0
        PollValue                     : 0x00
        Memory Detail                 :

                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuses          0     0     0    0 no          9    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse0          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse1          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse2          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse4          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse5          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse6          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse7          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        fuse8          0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        lock           0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        data           0     0     0    0 no          0    0      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        usersig        0     0     0    0 no         32   32      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        flash          0     0     0    0 no       4096   64      0     0     0 0x00 0x00
                                Block Poll               Page                       Polled
        Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
        ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
        eeprom         0     0     0    0 no        128   32      0     0     0 0x00 0x00

        Programmer Type : JTAGMKII_PDI
        Description     : JTAGv2 to UPDI bridge
avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x01): 
avrdude: jtagmkII_send(): sending 2 bytes
avrdude: Send: . [1b] . [03] . [00] . [02] . [00] . [00] . [00] . [0e] . [03] . [01] . [d3] . [99] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [03] 
avrdude: Recv: . [00] 
avrdude: Recv: . [03] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [81] . [01] . [01] 
avrdude: Recv: . [ed] 
avrdude: Recv: . [cd] 

avrdude: jtagmkII_recv(): Got message seqno 3 (command_sequence == 3)
avrdude: Recv: . [81] . [01] . [01] 

Raw message:
0x81 0x01 0x01 
parameter values:
0x01  0x01  

avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x02): 
avrdude: jtagmkII_send(): sending 2 bytes
avrdude: Send: . [1b] . [04] . [00] . [02] . [00] . [00] . [00] . [0e] . [03] . [02] . [aa] B [42] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [04] 
avrdude: Recv: . [00] 
avrdude: Recv: . [05] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [81] . [00] . [06] . [00] . [06] 
avrdude: Recv: . [ca] 
avrdude: Recv: . [db] 

avrdude: jtagmkII_recv(): Got message seqno 4 (command_sequence == 4)
avrdude: Recv: . [81] . [00] . [06] . [00] . [06] 

Raw message:
0x81 0x00 0x06 0x00 0x06 
parameter values:
0x00  0x06  0x00  0x06  

        M_MCU hardware version: 1
        M_MCU firmware version: 6.00
        S_MCU hardware version: 1
        S_MCU firmware version: 6.00
        Serial number:          00:00:00:00:00:00
avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x06): 
avrdude: jtagmkII_send(): sending 2 bytes
avrdude: Send: . [1b] . [05] . [00] . [02] . [00] . [00] . [00] . [0e] . [03] . [06] s [73] I [49] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [05] 
avrdude: Recv: . [00] 
avrdude: Recv: . [03] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [81] . [88] . [13] 
avrdude: Recv: x [78] 
avrdude: Recv: M [4d] 

avrdude: jtagmkII_recv(): Got message seqno 5 (command_sequence == 5)
avrdude: Recv: . [81] . [88] . [13] 

Raw message:
0x81 0x88 0x13 
parameter values:
0x88  0x13  

        Vtarget         : 5.0 V

avrdude: jtagmkII_initialize(): trying to set baudrate to 115200
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x05, 1 bytes): 
avrdude: jtagmkII_send(): sending 3 bytes
avrdude: Send: . [1b] . [06] . [00] . [03] . [00] . [00] . [00] . [0e] . [02] . [05] . [07] . [88] . [b0] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [06] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [c3] 
avrdude: Recv: . [1f] 

avrdude: jtagmkII_recv(): Got message seqno 6 (command_sequence == 6)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: jtagmkII_set_devdescr(): Sending set device descriptor command: 
avrdude: jtagmkII_send(): sending 299 bytes
avrdude: Send: . [1b] . [07] . [00] + [2b] . [01] . [00] . [00] . [0e] . [0c] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] @ [40] . [00]   [20] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [10] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] @ [40] . [00] . [00] . [00] . [00] . [00] . [00] . [01] . [02] . [00] . [00] . [00] . [00] . [00] . [00] . [00] . [00] ? [3f] W [57] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [07] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: | [7c] 
avrdude: Recv: . [9e] 

avrdude: jtagmkII_recv(): Got message seqno 7 (command_sequence == 7)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description
avrdude: jtagmkII_reset(): Sending reset command: 
avrdude: jtagmkII_send(): sending 2 bytes
avrdude: Send: . [1b] . [08] . [00] . [02] . [00] . [00] . [00] . [0e] . [0b] . [01] . [de] . [fe] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [08] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [ce] 
avrdude: Recv: / [2f] 

avrdude: jtagmkII_recv(): Got message seqno 8 (command_sequence == 8)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: jtagmkII_read_byte(.., signature, 0x0, ...)
avrdude: jtagmkII_program_enable(): Sending enter progmode command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [09] . [00] . [01] . [00] . [00] . [00] . [0e] . [14] . [dc] | [7c] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [09] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [a5] 
avrdude: Recv: . [de] 
avrdude: Recv: . [d8] 

avrdude: jtagmkII_recv(): Got message seqno 9 (command_sequence == 9)
avrdude: Recv: . [a5] 

Raw message:
0xa5 
Illegal MCU state

avrdude: jtagmkII_program_enable(): bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
avrdude: jtagmkII_program_enable(): Sending enter progmode command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [0a] . [00] . [01] . [00] . [00] . [00] . [0e] . [14] . [0c] . [f6] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [0a] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [a5] 
avrdude: Recv: . [0e] 
avrdude: Recv: R [52] 

avrdude: jtagmkII_recv(): Got message seqno 10 (command_sequence == 10)
avrdude: Recv: . [a5] 

Raw message:
0xa5 
Illegal MCU state

avrdude: jtagmkII_program_enable(): bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
avrdude: jtagmkII_read_byte(): Sending read memory command: 
avrdude: jtagmkII_send(): sending 10 bytes
avrdude: Send: . [1b] . [0b] . [00] . [0a] . [00] . [00] . [00] . [0e] . [05] . [b4] . [01] . [00] . [00] . [00] . [00] . [11] . [00] . [00] . [1a] . [d4] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [0b] 
avrdude: Recv: . [00] 
avrdude: Recv: . [02] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [a5] . [01] 
avrdude: Recv: 6 [36] 
avrdude: Recv: . [1d] 

avrdude: jtagmkII_recv(): Got message seqno 11 (command_sequence == 11)
avrdude: Recv: . [a5] . [01] 

Raw message:
0xa5 0x01 
Illegal MCU state: Running

avrdude: jtagmkII_read_byte(): bad response to read memory command: RSP_ILLEGAL_MCU_STATE
avr_read(): error reading address 0x0000
    read operation not supported for memory "signature"
avrdude: error reading signature data for part "ATtiny402", rc=-2
avrdude: error reading signature data, rc=-2
avrdude: jtagmkII_program_disable(): Sending leave progmode command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [0c] . [00] . [01] . [00] . [00] . [00] . [0e] . [15] 4 [34] . [fa] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [0c] 
avrdude: Recv: . [00] 
avrdude: Recv: . [02] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [a5] . [00] 
avrdude: Recv: ] [5d] 
avrdude: Recv: . [e5] 

avrdude: jtagmkII_recv(): Got message seqno 12 (command_sequence == 12)
avrdude: Recv: . [a5] . [00] 

Raw message:
0xa5 0x00 
Illegal MCU state: Stopped

avrdude: jtagmkII_program_disable(): bad response to leave progmode command: RSP_ILLEGAL_MCU_STATE
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending GO command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [0d] . [00] . [01] . [00] . [00] . [00] . [0e] . [08] . [ef] . [b0] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [0d] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [af] 
avrdude: Recv: . [b8] 

avrdude: jtagmkII_recv(): Got message seqno 13 (command_sequence == 13)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: jtagmkII_close(): Sending sign-off command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Send: . [1b] . [0e] . [00] . [01] . [00] . [00] . [00] . [0e] . [00] w [77] . [b6] 
avrdude: jtagmkII_recv():
avrdude: Recv: . [1b] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [00] 
avrdude: Recv: . [01] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [00] 
avrdude: Recv: . [0e] 
avrdude: Recv: . [80] 
avrdude: Recv: . [7f] 
avrdude: Recv: 2 [32] 

avrdude: jtagmkII_recv(): Got message seqno 14 (command_sequence == 14)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude done.  Thank you.
`
voneiden commented 3 years ago

45 appears to have same symptom?

Frogieder commented 3 years ago

Duplicate of #45

Yes, that issue really seems to reference the same problem

voneiden commented 3 years ago

Would #43 help? Worth trying?

Frogieder commented 3 years ago

Unfortunately not, as I said, I tried both options -e and -t -F yet both of them gave me the same error

Frogieder commented 3 years ago

Alright, a big update: I managed to get into the terminal mode. I hadn't uncommented a line in sys.h that I was supposed to. The same problem as in the issue you linked - I just didn't read anything. There is another error when I type in erase but there may be something I missed, so I'm going to do some research on my own again before I report a problem