hinata46243 / mega-isp

Automatically exported from code.google.com/p/mega-isp
0 stars 0 forks source link

EEPROM getting error when over about 255 bytes #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

If I try and write over about 255 bytes to EEPROM, the check fails.
Command Line:
c:/WinAVR-20100110/bin/avrdude.exe -Cc:/WinAVR-20100110/bin/avrdude.conf -v
-pm328p -cstk500v1 -P//./COM10 -b19200
-Ueeprom:w:c:/Users/rich/AppData/Local/Temp/./build1566342148913742156.tmp/HotWa
ter.cpp.eep:i

Fuse bits and program flash work fine. Also can write < 255 bytes to EEPROM
and that works fine. 

Target CPU - Atmega328P (8Mhz internal clock)

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
OS - Win7 64 bit
IDE - Arduino 18
Using Cygwin for command line interface.
avrisp.pde - the version available in Arduino release 18 - almost identical
code. They added read signature command.
Avrdude - EEPROM write fails with either version 5.4 as supplied with
Arduino or 5.10 from WinAVR. Using appropriate conf files with each version.

Please provide any additional information below.

Output from Avrdude:

avrdude.exe: Version 5.10, compiled on Jan 19 2010 at 10:45:23
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is
"c:/WinAVR-20100110/bin/avrdude.conf"

             Using Port                    : //./COM10
             Using Programmer              : stk500v1
             Overriding Baud Rate          : 19200
             AVR Part                      : ATMEGA328P
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PC2
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             ByteDelay                     : 0
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :

                                      Block Poll               Page
          Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW
 MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------
-----
 ----- ---------
               eeprom        65     5     4    0 no       1024    4      0
 3600
  3600 0xff 0xff
               flash         65     6   128    0 yes     32768  128    256
 4500
  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0
 4500
  4500 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0
 4500
  4500 0x00 0x00
               efuse          0     0     0    0 no          1    0      0
 4500
  4500 0x00 0x00
               lock           0     0     0    0 no          1    0      0
 4500
  4500 0x00 0x00
               calibration    0     0     0    0 no          1    0      0
    0
     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0
    0
     0 0x00 0x00

             Programmer Type : STK500
             Description     : Atmel STK500 Version 1.x firmware
             Hardware Version: 2
             Firmware Version: 1.18
             Topcard         : Unknown
             Vtarget         : 0.0 V
             Varef           : 0.0 V
             Oscillator      : Off
             SCK period      : 0.1 us

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.14s

avrdude.exe: Device signature = 0x1e950f
avrdude.exe: safemode: lfuse reads as E2
avrdude.exe: safemode: hfuse reads as DF
avrdude.exe: safemode: efuse reads as 5
avrdude.exe: reading input file
"c:/Users/rich/AppData/Local/Temp/./build1566342
148913742156.tmp/HotWater.cpp.eep"
avrdude.exe: writing eeprom (618 bytes):

Writing | ################################################## | 100% 41.21s

avrdude.exe: 618 bytes of eeprom written
avrdude.exe: verifying eeprom memory against
c:/Users/rich/AppData/Local/Temp/./
build1566342148913742156.tmp/HotWater.cpp.eep:
avrdude.exe: load data eeprom data from input file
c:/Users/rich/AppData/Local/T
emp/./build1566342148913742156.tmp/HotWater.cpp.eep:
avrdude.exe: input file
c:/Users/rich/AppData/Local/Temp/./build1566342148913742
156.tmp/HotWater.cpp.eep contains 618 bytes
avrdude.exe: reading on-chip eeprom data:

Reading | ################################################## | 100% 13.21s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
             0x57 != 0x53
avrdude.exe: verification error; content mismatch

avrdude.exe: safemode: lfuse reads as E2
avrdude.exe: safemode: hfuse reads as DF
avrdude.exe: safemode: efuse reads as 5
avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

$

Original issue reported on code.google.com by richholl...@gmail.com on 9 Mar 2010 at 1:39

GoogleCodeExporter commented 8 years ago
The current implementation won't write more than 256 bytes to the EEPROM at 
once. It should be possible to increase this.

Original comment by rsb...@gmail.com on 9 Oct 2010 at 9:57

GoogleCodeExporter commented 8 years ago
Please try the attached sketch. I changed write_eeprom to handle more than 256 
bytes. This code is not yet in the repository.

Original comment by rsb...@gmail.com on 12 Oct 2010 at 1:12

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the update but there is still a problem. By using the -03 version of 
the code I can write flash program to the target 328. But the eeprom write 
fails when over 256 bytes of data is sent.
With the new -04 version eeprom fails the same as before and writing flash 
fails also. The error output for writing flash is:

Binary sketch size: 870 bytes (of a 32254 byte maximum)
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x64
avrdude: failed to write flash memory, rc=-4
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I have been able to read the fuse bits with the -04 version but have not tried 
writing fuses.

Original comment by richholl...@gmail.com on 12 Oct 2010 at 9:43

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
This should write EEPROM corectly. The SPI calls in .03 had the MSB hard coded 
to 0x00.

WARNING: This will not write flash! Still working on that...

Original comment by rsb...@gmail.com on 13 Oct 2010 at 5:05

Attachments:

GoogleCodeExporter commented 8 years ago
YES! Version -04a writes my 618 bytes to eeprom with no errors from avrdude. 
Did not try the flash yet as you advised...
Thanks...

Original comment by richholl...@gmail.com on 13 Oct 2010 at 12:10

GoogleCodeExporter commented 8 years ago
Write EEPROM and flash > 256 bytes!
-Pulse LED_PMODE while writing flash, EEPROM
-Light LED_ERR whenever we have STK_NOSYNC

Tested on ATMega328p chip.

Original comment by rsb...@gmail.com on 13 Oct 2010 at 1:49

Attachments:

GoogleCodeExporter commented 8 years ago
Version 04b Works! Write and read eeprom. Write and read flash. Write and read 
fuse bits. Great! All was tested on a 328p chip as the ISP and the target. 
Thanks.

Original comment by richholl...@gmail.com on 13 Oct 2010 at 8:16

GoogleCodeExporter commented 8 years ago
This is great!
I've been having consistent problem with stock ArduinoISP that came with the 
Arduino-0021.
I kept getting this error:
avrdude: stk500_paged_write(): (a) protocol error, expect=0x14, resp=0x11

Now with version dev04b it works fine!
Thank you so much, i really wish I had found this post a few hours earlier :)

Original comment by han...@gmail.com on 14 Dec 2010 at 6:12

GoogleCodeExporter commented 8 years ago
Hey this worked for me too - using the arduino-22 IDE, I was unable to flash 
ATMEGA328P chips. 

Unzipping ArduinoISP-dev04b.zip in arduino-22/examples/, restarting the IDE and 
selecting Arduino-dev04b, I loaded this onto my programmer Duemilanove and then 
hitting Tools->Burn Bootloader->w/Arduino as ISP, I was able to repair 3 
"bricked" chips in my collection!

Thank you, hope this fix is in arduino-23!

Original comment by darthrac...@gmail.com on 20 Mar 2011 at 12:58

GoogleCodeExporter commented 8 years ago
ArduinoISP-dev04b.zip solved an issue when trying to flash a Sparkfun Serial 
graphic backpack to use SummoningDark's firmware upgrade.

With the ArduinoISP in Arduino-0022 an avrdude sync error would always occur on 
flashing but not for other operations such as -e (erase)

Original comment by jonnobl...@gmail.com on 21 Jul 2011 at 9:11

GoogleCodeExporter commented 8 years ago
I was trying to flash my 32u4 to the Leonardo boot loader and ran into this 
same issue. I pulled 4b into RC1 and it wouldnt compile so I downloaded 022 and 
pushed this to my Uno. Then switched back to Rc1 to burn leonardo to my 32u4.

I hope this patch makes it into RC1 soon!

Original comment by engrstep...@gmail.com on 23 Sep 2011 at 1:58

GoogleCodeExporter commented 8 years ago
Resolved with 05 version look at the issues. I can't contact the owner to 
correct in the main.

Original comment by occhiobe...@gmail.com on 17 Nov 2011 at 8:35

GoogleCodeExporter commented 8 years ago
It works great ! You saved my evening. I was beginning to think that i had 
borrowed my friend's Arduino for nothing and that my ATMega328p was dead.
Thanks to you, i could reflash the bootloader and it works fine.
Still, it means that the ArduinoISP that is shipped on last Ubuntu has a bug... 

Original comment by mathieu....@gmail.com on 6 Dec 2011 at 8:58

GoogleCodeExporter commented 8 years ago
With arduino 1.0 and ArduinoISP-dev04b as submitted here, it fails while 
writing, with the following error :
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

The problem is already fixed in 1.01 :
http://code.google.com/p/arduino/issues/detail?id=661

Original comment by andafro...@gmail.com on 29 Dec 2011 at 4:22

GoogleCodeExporter commented 8 years ago
ArduinoISP-dev for Arduino IDE version 1.0.5?

Original comment by Parthasa...@gmail.com on 3 Dec 2013 at 1:48

GoogleCodeExporter commented 8 years ago
Trying to burn a bootloader into ATmega32a using Arduino Mega2560 as an ISP but 
I keep getting this error even after disabling the auto-reset with a 100nF 
capacitor between the +5V and RESET on the Mega.

avrdude.exe: stk500_program_enable(): protocol error, expect=0x14, 
resp=0x50avrdude.exe: initialization failed, rc=-1              
Double check connections and try again, or use -F to override this 
check.avrdude.exe: stk500_disable(): protocol error, expect=0x14, resp=0x51

My ATmega32a is on a Dev Board I built and not on an Arduino board.

I have the same query as:

#16 Parthasa...@gmail.com
ArduinoISP-dev for Arduino IDE version 1.0.5?

Original comment by shirim...@gmail.com on 7 Apr 2014 at 6:16