A programmer is required to upload for ATtiny402

Hi ,

I am using Attiny402 controller and programmer ATMEL ICE for uploading a simple led blink code. But I always get the error message as "A programmer is required to upload".

I also tried with "sketch>upload using programmer" method, but uploading message was there for a long time means I am not getting upload done or success. Kindly help me.

Hi @joju0407. I'm going to ask you to post the full verbose output from an upload.


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


Please do this:

  1. Select File > Preferences... from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Click the OK button.
  5. Attempt an upload, as you did before.
  6. Wait until you are certain the upload went into a hang state.
  7. Right click on the black "Output" panel at the bottom of the Arduino IDE window.
  8. From the context menu, click Copy All.
  9. Open a forum reply here by clicking the Reply button.
  10. Click the <CODE/> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code tags icon on toolbar
  11. Press Ctrl+V.
    This will paste the compilation output into the code block.
  12. Move the cursor outside of the code tags before you add any additional text to your reply.
  13. Click the Reply button to post the output.
Sketch uses 382 bytes (9%) of program storage space. Maximum is 4096 bytes.
Global variables use 10 bytes (3%) of dynamic memory, leaving 246 bytes for local variables. Maximum is 256 bytes.
"C:\Users\EMBEDDED\AppData\Local\Arduino15\packages\DxCore\tools\avrdude\6.3.0-arduino17or18/bin/avrdude" "-CC:\Users\EMBEDDED\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.8/avrdude.conf" -v  -pattiny402 -cjtag2updi -PCOM11 -b115200 "-Ufuse0:w:0b00000000:m" "-Ufuse2:w:0x01:m" "-Ufuse5:w:0b11000101:m" "-Ufuse6:w:0x04:m" "-Ufuse7:w:0x00:m" "-Ufuse8:w:0x00:m" "-Uflash:w:C:\Users\EMBEDDED\AppData\Local\Temp\arduino\sketches\FF2CC76A97946CAB7A2A0FEA86428253/sketch_jul12a.ino.hex:i"

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

         System wide configuration file is "C:\Users\EMBEDDED\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.8/avrdude.conf"

         Using Port                    : COM11
         Using Programmer              : jtag2updi
         Overriding Baud Rate          : 115200
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                      : 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
           prodsig        0     0     0    0 no         61   61      0     0     0 0x00 0x00
           fuses          0     0     0    0 no          9   10      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       4096   64      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        128   32      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_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_NO_TARGET_POWER

avrdude done.  Thank you.

Failed programming: uploading error: exit status 1

@ptillisch ,
The above snippets I got when tried Arduino Uno as UPDI programmer for Attiny402, but no progress.

Also I followed all procedure mentioned in GitHub - ElTangas/jtag2updi: UPDI programmer software for Arduino (targets Tiny AVR-0/1/2, Mega AVR-0 and AVR-DA/DB MCUs)
kindly help me.

Unfortunately I'm not familiar with the ATtiny402 or the use of Arduino UNO as an UPDI programmer so I won't be able to help with the error message you shared. Hopefully one of the other forum members will be able to provide assistance. I would recommend that you carefully check all the circuits, including the support circuitry for the ATtiny402 and the connections between the UNO and the ATtiny402.

In some rare cases, jumper wires can be defective or damaged in a way that causes there to be no conductivity through the jumper wire even though the jumper appears intact from a visual inspection so you might also want to check the electrical continuity through your circuit. That can easily be done using a multimeter set to the continuity check mode (usually indicated by a diode symbol on the mode selector switch).

Something that might be useful to the helper is if you also post the output from attempting an "Upload Using Programmer" operation with your Atmel-ICE programmer.

I can add some notes about the problems you experienced with Arduino IDE:

As the message says, a programmer is required to upload to the ATtiny402. It is not possible to do uploads directly via the serial port as is done on the more common Arduino boards. So this means that an upload to the ATtiny402 is always an "Upload Using Programmer" operation. Arduino IDE 1.x has a feature that allows the boards platform developer to configure the definitions for boards like this so that the "Upload" button will trigger an "Upload Using Programmer" operation instead of a normal upload. Unfortunately that feature has not been added to Arduino IDE 2.x:

So when you are using the ATtiny402 board with Arduino IDE 2.x you must remember to always select Sketch > Upload Using Programmer from the Arduino IDE menus when you want to upload.

The AVRDUDE tool that is used to upload sketch programs to your ATtiny402 often spends an excruciatingly long time retrying a failed upload over and over and over again before it finally gives up and exits. This can give the impression that the upload hung permanently.

AVRDUDE also does hang permanently under certain conditions when an upload fails.

In both of these cases, you can usually force the tool to exit by disconnecting the USB cable of the programmer from your computer.

There is also a known bug in Arduino IDE that can cause it to remain in the uploading state even after the upload tool process exits:

If you were affected by that bug, you would see the message in the "Output" panel at the bottom of the Arduino IDE window that shows the process finished:

but the IDE would remain in the uploading state, as indicated by the in progress notification at the bottom right corner of the IDE window:

image

Do you have a solution yet?

I use PlatformIO to programme ATtiny402 devices but you can use an Arduino as programmer too.

I still use Arduino IDE to 'download boot loader' - on an ATtiny402 (any bare bones AVR for that matter) this just lets you blow fuses as per the option selections - a key one is the brown out threshold voltage.

I use a modified USB to TTY adaptor and a Python script to do the biz.

PlatformIO is free and uses Arduino wrapper so you still have access to stuff like millis() if you want.

Here's some comments from a gadget geo cache I just built...

/*	General approach to UPDI
	I purchased an original ATtiny402 direct from Microchip - the exact part code was ATTINY402-SSN. 
	This part was available as it's not automotive spec and comes in a tube so there was no part reel cutting fee.

	The upload command used pymcuprog which had to be installed within PlatformIO.

	The ATtiny402 was programmed using a UPDI programmer made from a UTP to serial device with a diode betwen TXD and RXD.

			--------------------                                 To Target device
		           			DTR|                      330 ohm     __________________
		    	internal    Rx |--------------,--------\/\/------| UPDI------------->
	    	  Tx---/\/\/\---Tx |-------|<|---'          .--------| Gnd     
	    		resistor    Vcc|---------------------------------| Vcc
		    	typ 1-2k    CTS|                     .`          |__________________
		          			Gnd|--------------------'             If you make a 3-pin connector, use this pinout
			--------------------

	<https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md>
	<https://pypi.org/project/pymcuprog/>
	<https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/PlatformIO.md>
	<https://docs.platformio.org/en/latest/platforms/atmelmegaavr.html#upload-using-pymcuprog-serialupdi>
	<https://community.platformio.org/t/problems-migrating-from-studio-7-to-platformio-attiny402-with-pymcuprog-custom-tool/29352/9>

	I used Studio START code generator to get used to the peripheral configuration code
	I put all the initial set up required in a system_init() routine and put this code at the bottom 
	below the main() loop structure.
*/

Check out these links for great stuff posted by Spence Konde (AKA Dr Azzy) - excellent.

You can even build a cheap HV programmer using the same kit (I haven't done this yet waiting on the MAX4544 chips) - see here http://www.technoblogy.com/show?48MP

If you are still struggling, post a response and I'll try to help some more - by the way - I am a relative newbie so don't take what I say too seriously.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.