AVR-ISP-MK2 and AVRDUDE EEPROM programming

Started by BuriedCode, May 30, 2020, 10:42:44 pm

Previous topic - Next topic

BuriedCode

Hi, first post, so sorry if I miss something.

I searched the forum and found plenty of posts about your AVR-ISP-MK2 and getting it working with AVRDUDE and AVR studio but I couldn't find a post relating this specific problem.

I bought this programmer off ebay, so I do not know its firmware, however, it works flawlessly with Atmel Studio 6.2, and with AVRDUDE 6.3 (using AVRDUDESS, the GUI v2.11).
 
AVRDUDE 6.1 and earlier however, fails to recognize that the programmer is plugged in.

So, the problem is, it appears it cannot write to the EEPROM of an ATMEG8535.
Writing the flash, fuses and lock bits all verifies nicely, and without fail.
Writing to the EEPROM provides the following output:

avrdude.exe: reading input file "C:\xxxx\yyyy.eep"
avrdude.exe: input file C:\xxxx\fyyyy.eep auto detected as Intel Hex
avrdude.exe: writing eeprom (32 bytes):

Writing | ############avrdude.exe: stk500v2_command(): warning: Command timed out
avrdude.exe: stk500v2_paged_write: write command failed
###################################### | 100% 1.14s

avrdude.exe: 32 bytes of eeprom written
avrdude.exe: verifying eeprom memory against C:\xxxx\yyyy.eep:
avrdude.exe: load data eeprom data from input file C:\xxxx\yyyy.eep:
avrdude.exe: input file C:\xxxx\yyyy.eep auto detected as Intel Hex
avrdude.exe: input file C:\xxxx\yyyy.eep contains 32 bytes
avrdude.exe: reading on-chip eeprom data:

Reading | ################################################## | 100% 0.02s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0008
             0x08 != 0x64
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.
 

I'm fairly sure it has been able to write to the EEPROM a couple of times - only when it was the first thing I did in AVRDUDESS, but now it consistently fails.

So just as a summary:
AVRDUDE v6.3
AVRDUDESS V2.11
MCU: Atmega8535-16PU
Programmer: AVR-ISP-MK2 form Olimex
Target power: From programmer (4.3-4.5V).

Things I have tried:
- Providing an external power supply, 4.9V (removing jumper on AVR ISP providing target power).  No change.

- Using a cheap USBasp board from aliexpress.  Works fine, for flash, eeprom, and fuses.

- Testing flash, eeprom, fuses and lock bits in Atmel Studio 6.2: Works flawlessly.

I wouldn't normally post about something relatively minor and specific, but I wanted to provide colleagues with a "back up" host software for configuring legacy hardware, and I was hoping AVRdude would be it (rather than having to install the rather large Atmel Studio 6.2 for flashing one device). 

Just wondered if anyone had a similar problem.  This isn't urgent or anything.

LubOlimex

Just so some more info is available for others that might have idea what is going on - what is the exact command that you use with AVRDUDE? Maybe some of the settings or flags can be adjusted.

Also it seems there are a lot of people in the arduino and avrfreaks forums that encountered similar error (albeit using different tools). Still worth checking on it.
Technical support and documentation manager at Olimex

BuriedCode

Hi, sorry for the late reply.

'm still using AVRDUDESS as it's just easier, and I can see the command line it sends.
So the command I used to write to the EEPROM, the part that fails:

avrdude -u -c avrispmkII -p m8535 -U eeprom:w:"C:\Users\xxxx\xxxx\xxxxx.eep":a
The command to write flash - which succeeds:
avrdude -u -c avrispmkII -p m8535 -U flash:w:"C:\Users\xxxx\xxxx\xxxxx.hex":a
I did try to slow the bit clock down, just in case, but still got the same problem:
avrdude -u -c avrispmkII -p m8535 -B 10 -U eeprom:w:"C:\Users\xxxx\xxxx\xxxxx.eep":a
The *.eep is correctly identified as Intel format,

I also tried different USB ports and cable, but the problem remains.  Just to reiterate, this works fine with AVR studio 6.2, and with a cheap USBasp programmer (with AVRDUDE), so I know the hardware is OK.

I'll post on AVRfreaks as well, thanks