[SOLVED] Atmel ICE No Longer Working with AVRDUDE

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For some reason my Atmel ICE no longer works when I try to flash an ATtiny1617 using UPDI with AVRDUDE. In the past it had been working flawlessly with both the 1617 using UPDI and an 84a using ISP.

 

I am using Arch Linux and AVRDUDE built from the SVN repository. I have tried reverting my entire system to the last known working state, trying an extra Atmel ICE, and swapping between two different USB cables to no avail.

 

I attempt to run the following command:

sudo avrdude -v -p attiny1617 -c atmelice_updi -U flash:w:file

The output I receive is:

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 "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : atmelice_updi
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
         AVR Part                      : ATtiny1617
         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      16384   64      0     0     0 0x00 0x00
           eeprom         0     0     0    0 no        256   32      0     0     0 0x00 0x00

         Programmer Type : JTAGICE3_UPDI
         Description     : Atmel-ICE (ARM/AVR) in UPDI mode
         ICE hardware version: 0
         ICE firmware version: 1.39 (rel. 130)
         Serial number   : J41800064225
         Vtarget         : 3.30 V
         JTAG clock megaAVR/program: 1000 kHz
         JTAG clock megaAVR/debug:   1000 kHz
         JTAG clock Xmega: 1000 kHz
         PDI clock Xmega : 100 kHz

avrdude: Short read, read only 0 out of 512 bytes
avrdude: jtag3_edbg_recv(): Unexpected response 0x40
avrdude: retrying with external reset applied
avrdude: Short read, read only 0 out of 512 bytes
avrdude: jtag3_edbg_send(): Unexpected response 0x00, 0x00
avrdude: Short read, read only 0 out of 512 bytes
avrdude: jtag3_edbg_recv(): Unexpected response 0x60
avrdude: retrying with external reset applied
avrdude: JTAGEN fuse disabled?
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: Failed to write 512 bytes to USB
avrdude: jtag3_edbg_send(): failed to send command to serial port
avrdude: Failed to write 512 bytes to USB
avrdude: jtag3_edbg_recv(): error sending CMSIS-DAP vendor command
avrdude: Failed to write 512 bytes to USB
avrdude: jtag3_edbg_send(): failed to send command to serial port
avrdude: Failed to write 512 bytes to USB
avrdude: jtag3_edbg_recv(): error sending CMSIS-DAP vendor command
avrdude: Failed to write 512 bytes to USB
avrdude: jtag3_edbg_signoff(): failed to send command to serial port

avrdude done.  Thank you.

After this point the Atmel ICE "freezes up". The green light remains on even after turning off the 3.30V supply and the command hangs if I try to run it again unless I unplug the device from my computer and reconnect it.

 

I'm rather stumped. Any clues on where to go from here?

This topic has a solution.
Last Edited: Fri. Feb 28, 2020 - 09:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For a short time, it looked like

 

https://github.com/facchinm/avrdude

 

Was collecting stuff (you may find a UPDI update in there). I think that is what got put on Raspian (maybe Arch also). But I guess Arduino is using a patch script and does not need those updates with MuxTO doing the job.

 

https://github.com/arduino/avrdu...

 

I am not planning to use avrdude for UPDI parts since it is UART based, I am good with pyupdi, plus I can understand Python, with avrdude the build (Autoconf/Automake, and Libtool) has too much impedance mismatch for my wiring.

 

https://github.com/mraardvark/py...

 

my projects: https://github.com/epccs

Debugging is harder than programming - don’t write code you can’t debug! https://www.avrfreaks.net/forum/help-it-doesnt-work

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ron_sutherland wrote:

For a short time, it looked like

 

https://github.com/facchinm/avrdude

 

Was collecting stuff (you may find a UPDI update in there). I think that is what got put on Raspian (maybe Arch also).

 

 

I built and used this version of AVRDUDE, but ended up having the same output in my original post. No luck there.

 

ron_sutherland wrote:

I am not planning to use avrdude for UPDI parts since it is UART based, I am good with pyupdi, plus I can understand Python, with avrdude the build (Autoconf/Automake, and Libtool) has too much impedance mismatch for my wiring.

 

https://github.com/mraardvark/py...

 

 

I went ahead and gave this a shot too; it failed, providing the follow output:

 

sudo python3 pyupdi.py -d tiny1617 -c /dev/ttyUSB0 -b 115200 -v -e -f test.elf 

INFO:phy Opening /dev/ttyUSB0 at 115200 baud
INFO:phy send : [0x0]
INFO:link STCS to 0x03
INFO:phy send : [0x55, 0xc3, 0x8]
INFO:link STCS to 0x02
INFO:phy send : [0x55, 0xc2, 0x80]
INFO:link LDCS from 0x00
INFO:phy send : [0x55, 0x80]
INFO:phy receive : []
INFO:link UPDI not OK - reinitialisation required
INFO:phy Sending double break
INFO:phy Opening /dev/ttyUSB0 at 115200 baud
INFO:link STCS to 0x03
INFO:phy send : [0x55, 0xc3, 0x8]
INFO:link STCS to 0x02
INFO:phy send : [0x55, 0xc2, 0x80]
INFO:link LDCS from 0x00
INFO:phy send : [0x55, 0x80]
INFO:phy receive : []
INFO:link UPDI not OK - reinitialisation required
Traceback (most recent call last):
  File "pyupdi.py", line 178, in <module>
    _main()
  File "pyupdi.py", line 93, in _main
    nvm = UpdiNvmProgrammer(comport=args.comport,
  File "[removed]/pyupdi/updi/nvm.py", line 17, in __init__
    self.application = UpdiApplication(comport, baud, device)
  File "[removed]/pyupdi/application.py", line 17, in __init__
    self.datalink = UpdiDatalink(comport, baud)
  File "[removed]/pyupdi/updi/link.py", line 31, in __init__
    raise Exception("UPDI initialisation failed")
Exception: UPDI initialisation failed
INFO:phy Closing /dev/ttyUSB0

I'm using a 4.7K resistor between the TX/RX lines as specified in the README, and a logic analyzer I'm using is reading the "phy send" values correctly from the microcontroller's pins. I can't figure out why it's failing. Any clues?

Last Edited: Fri. Jan 31, 2020 - 08:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try adding your username to dialout group perhaps?

 

sudo usermod -a -G dialout username

logout, login and try again without the sudo.

 

Also do a loopback test if that did not work (e.g., picocom or whatever you like) to make sure the serial hardware is working.

 

update: serial is clearly working, it may be the .elf file, you need to send a .hex file.

 

https://github.com/mraardvark/py...

my projects: https://github.com/epccs

Debugging is harder than programming - don’t write code you can’t debug! https://www.avrfreaks.net/forum/help-it-doesnt-work

Last Edited: Sat. Feb 1, 2020 - 07:10 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Bah. It seems I'm simply of poor luck. Both of the two ATtiny1617s I was testing with are dead, but the new one I just received works perfectly.

 

I greatly appreciate your time and effort. I will mark this thread as solved and leave it up in case some future reader may find your resources helpful.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brunste wrote:
I will mark this thread as solved 

It's great of you to think of that!

 

smiley

 

For how to do it so that the forum knows, see Tip #5 in my signature, below (may not be visible on mobile)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...