Upload to ATTiny3217 failing

I uploaded a sketch to an ATTiny3217 and it appeared to work. Because I wanted to change the UPDI pin to GPIO I uploaded a bootloader to set it to GPIO. Now I am unable to uploaded any modified sketches. It comes up with the following error.

I am using a Nano on a HV programming board (Dlloyd's).

Any ideas?

PS. I can't burn any bootloaders either.

Arduino: 1.8.13 (Linux), Board: "ATtiny3217/1617/1607/817/807/417, ATtiny3217, 20 MHz, 1.8V (5 MHz or less), Disabled, Disabled, EEPROM retained, Enabled (default timer), Closer to 5v"

Sketch uses 21922 bytes (66%) of program storage space. Maximum is 32768 bytes.
Global variables use 158 bytes (7%) of dynamic memory, leaving 1890 bytes for local variables. Maximum is 2048 bytes.
/home/jason/snap/arduino/41/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf -v -pattiny3217 -cjtag2updi -P/dev/ttyUSB0 -Uflash:w:/tmp/arduino_build_307962/PI_GPI_ATRE_OLED_TNR_3217.ino.hex:i 

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

         System wide configuration file is "/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf"
         User configuration file is "/home/jason/snap/arduino/41/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : jtag2updi
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
         AVR Part                      : ATtiny3217
         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
           prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
           fuses          0     0     0    0 no          9    0      0     0     0 0x00 0x00
           fuse0          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse1          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse2          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse4          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse5          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse6          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse7          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse8          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0     0     0 0x00 0x00
           data           0     0     0    0 no          0    0      0     0     0 0x00 0x00
           usersig        0     0     0    0 no         32   32      0     0     0 0x00 0x00
           flash          0     0     0    0 no      32768  128      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        256   64      0     0     0 0x00 0x00

         Programmer Type : JTAGMKII_PDI
         Description     : JTAGv2 to UPDI bridge
         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
         Vtarget         : 5.0 V

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

Reading | avrdude: 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 "ATtiny3217", 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.

the selected serial port 
 does not exist or your board is not connected


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Long story short - an accident took out our cable (won't be re-connected until Wednesday). Running everything of the cellphone - limited data and time.

OK, this'll be short.

  • Update the programmer with the latest firmware (updated 2-days ago).
  • Looks like you might be powering up too much off the T5V pin ... OLED?
  • Change your target power to the 5V pin on the Nano's 6-pin connector.
  • Set jumper to HVPC mode ... try burning bootloader twice if the first try doesn't work.
  • Try disconnecting then re-connecting USB (this will power-cycle - blue HVLED will flash.
  • Switch your PA0 back to UPDI mode, then try burning bootloader twice.
    I've just run an ATtiny817 through all possibilities: PA0 as UPDI, Reset and GPIO with optiboot or UPDI (no optiboot) and it works fine using the latest firmware.

If your still having issues, please create an issue here and I'll help you out as soon as I can.

Thanks. I will give it a try this arvo.

Tried all of the above with the same results. :frowning:

I'm only guessing at your setup, but it seems you may have other circuitry connected. When PA0 is configured as GPIO, the only way to initiate the pin as UPDI is immediately after a power-cycle or immediatley after power up. If other peripherals (serial, OLED display, etc.) are connected and powered separately, this will interfere with the UPDI enable sequence. If other circuitry is connected to PA0, this will interfere with communication, even if its 12V tolerant.

I suggest programming using only 3 wires connected to your ATtiny3217 target board or breakout board (UPDI, GND, T5V). Everything else disconnected.

Try Board settings as follows:

  • Nano HV Programmer set to PCHV mode.

  • Manually power-cycle by pressing the reset button on the Nano. When released, the blue HVLED will flash.

  • Use Tools > Burn Bootloader (twice if necessary)
    If this fails, perhaps your target board is drawing to much power for PORTC on the Nano (T5V), or its voltage is a bit low (<4.8V), so now try the following:

  • For power, use the 5V pin on the Nano's 6-pin ISP connector instead of the T5V pin.

  • Perform a manual power-cycle by disconnecting, then re-connecting the USB cable, then wait at least 5-seconds.

  • Make sure the appropriate COM port is selected.

  • Use Tools > Burn Bootloader (twice if necessary).
    If this fails, I'll need the details of what target board you're using so I can try to duplicate the issue.

I tried all the settings you suggested. Using the 3217 with optiboot bootloader it gives this error.

PS. the blue LED doesn't flash when I press the reset button.

Arduino: 1.8.13 (Linux), Board: "ATtiny3217/1617/1607/817/807/417, ATtiny3217, 20 MHz, 4.2V (20 MHZ or less), Disabled, Disabled, EEPROM retained, Enabled (default timer), Closer to 5v"

Sketch uses 4473 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 201 bytes (9%) of dynamic memory, leaving 1847 bytes for local variables. Maximum is 2048 bytes.
/home/jason/snap/arduino/41/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf -v -pattiny3217 -carduino -P/dev/ttyUSB0 -D -b115200 -Uflash:w:/tmp/arduino_build_223414/Wondatre_R1.0.ino.hex:i 

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

         System wide configuration file is "/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf"
         User configuration file is "/home/jason/snap/arduino/41/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

If I try to burn the bootloader it gives me this error.

EDIT: Not sure what happened. IDE must have been playing up. Error has goneback to the original error after restarting the IDE.

Arduino: 1.8.13 (Linux), Board: "ATtiny3217/1617/1607/817/807/417 (Optiboot), ATtiny3217, 20 MHz, 4.2V (20 MHZ or less), Disabled, Disabled, Enabled (default timer), UPDI (powercycle to enter bootloader), Closer to 5v, TX:9, RX:8"

/home/jason/snap/arduino/41/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf -v -pattiny3217 -cjtag2updi -P/dev/ttyUSB0 -e -Ufuse0:w:0x00:m -Ufuse1:w:0b11100000:m -Ufuse2:w:0x02:m -Ufuse4:w:0x00:m -Ufuse5:w:0b11000100:m -Ufuse6:w:0x03:m -Ufuse7:w:0x00:m -Ufuse8:w:0x02:m -Uflash:w:/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/bootloaders/optiboot_x/optiboot_txy7.hex:i 

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

         System wide configuration file is "/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf"
         User configuration file is "/home/jason/snap/arduino/41/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : jtag2updi
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Device or resource busy

avrdude done.  Thank you.

Error while burning bootloader.


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

PS. the blue LED doesn't flash when I press the reset button.

No HV pulse :astonished:

Do you have the latest firmware installed, yellow jumper (WP) installed and red jumper installed on the red header on 2-pins closest to the blue LED?

If you do, then:

  • The blue LED should flash about 1 second after releasing the Nano's reset button.
  • It should also flash a few seconds after re-connecting the USB cable to the Nano.
  • Also just before programming starts.
    Jumper settings and connections :

Yellow = 5V, Green = GND, Blue = UPDI

EDIT: You need to remove the yellow jumper prior to updating the firmware.

Yep. Done all that but still no blue LED.

Also I noticed that when I updated some libraries the following warning popped up.

WARNING: Error loading hardware folder /home/jason/snap/arduino/current/Arduino/hardware/jtag2updi
No valid hardware definitions found in folder jtag2updi.

After you download and extract the zip file, you need to rename the jtag2updi-master folder to jtag2updi so it matches the Arduino sketch jtag2updi.ino (less extension).

I'll add this step to the installation instructions. EDIT ... done.

Yep. Did that as well.

This is going to be soooooooo simple in the end.

I'm not familiar with linux, but I would try moving the jtag2updi folder to where Arduino stores the sketches that you create. Then jtag2updi should be an option when you select File>Sketchbook>

If this fails, try the original code from ElTangas just to see if it installs and runs without any warning(s).

Do you have the latest version of megaTinyCore installed?

When I load jtag2updi it loads ok and uploads ok. Spence said I should have it in the hardware folder, same place as megatinycore.

I was going to ask what the difference between yours a Eltangas was.

I amgoing tothrow a CRO onit and see if the HV pulse is there or not. maybe the LED has failed or something.

And I am using the latest core,

When I load jtag2updi it loads ok and uploads ok

OK, you can test the upload process and the LEDs with the attached zip file below.
It just blinks the yellow LED on the nano and the blue HV LED (no 12V pulses are applied).
This'll test if your upload is successful and if the blue LED works.

Have the board set to Nano, remove the yellow jumper then run "Upload" (not "Upload Using Programmer").

jtag2updi.zip (1.39 MB)

The onboard LED flashes but the blue one doesnt.

Sent you a PM.

OK. Now blue LED is doing as it should. But now this error.

Arduino: 1.8.13 (Linux), Board: "ATtiny3217/1617/1607/817/807/417, ATtiny3217, 20 MHz, 1.8V (5 MHz or less), Disabled, Disabled, EEPROM retained, Enabled (default timer), Closer to 5v"

Sketch uses 21922 bytes (66%) of program storage space. Maximum is 32768 bytes.
Global variables use 158 bytes (7%) of dynamic memory, leaving 1890 bytes for local variables. Maximum is 2048 bytes.
/home/jason/snap/arduino/41/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/bin/avrdude -C/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf -v -pattiny3217 -cjtag2updi -P/dev/ttyUSB0 -Uflash:w:/tmp/arduino_build_551114/PI_GPI_ATRE_OLED_TNR_3217.ino.hex:i 

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

         System wide configuration file is "/home/jason/snap/arduino/current/Arduino/hardware/megaTinyCore/megaavr/avrdude.conf"
         User configuration file is "/home/jason/snap/arduino/41/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : jtag2updi
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
         AVR Part                      : ATtiny3217
         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
           prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
           fuses          0     0     0    0 no          9    0      0     0     0 0x00 0x00
           fuse0          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse1          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse2          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse4          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse5          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse6          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse7          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           fuse8          0     0     0    0 no          1    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0     0     0 0x00 0x00
           data           0     0     0    0 no          0    0      0     0     0 0x00 0x00
           usersig        0     0     0    0 no         32   32      0     0     0 0x00 0x00
           flash          0     0     0    0 no      32768  128      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        256   64      0     0     0 0x00 0x00

         Programmer Type : JTAGMKII_PDI
         Description     : JTAGv2 to UPDI bridge
         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
         Vtarget         : 5.0 V

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

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

avrdude done.  Thank you.

the selected serial port 
 does not exist or your board is not connected


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I amgoing tothrow a CRO onit and see if the HV pulse is there or not. maybe the LED has failed or something.

The HV pulse should look like this...

Yeah, I think you have / had a defective board. I'll send out a replacement tomorrow.

Thank you.

I finally got to take a snapshot of the UPDI pulse.

Sits at 2V, goes up to 5V for about 1ms then to 11.8 for 250us.