itsanjan / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

mega2560 bootloader doesn't support eeprom writes or erases #543

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. avrdude -e
2. avrdude -U eeprom:r:-:h

What is the expected output? What do you see instead?
Should be all 0xff, isn't actually erased.

1. avrdude -U eeprom:w:blah.eep

What is the expected output? What do you see instead?
Should succeed, fails verification.

This is because the stk500v2 bootloader on the 8u2 chip on the arduino mega 
2560 board has these pretty useful functions either defined out, or as a noop.

Please provide any additional information below.

At line 804, (case CMD_CHIP_ERASE_ISP:) in 
https://github.com/arduino/Arduino/blob/master/hardware/arduino/bootloaders/stk5
00v2/stk500boot.c you can see that chip erase is a NOOP.  I think this should 
at least return something indicating that it wasn't done, not that it succeeded.

At line 858 in the same file,
#if (!defined(__AVR_ATmega1280__) && !defined(__AVR_ATmega2560__)  && 
!defined(__AVR_ATmega2561__))

You can see that the code for programming the EEPROM on the megas is simply 
defined out.  if that code doesn't work on the megas, it should be replaced 
with code that does.

Original issue reported on code.google.com by tweakne...@googlemail.com on 18 May 2011 at 5:09

GoogleCodeExporter commented 9 years ago
I've done a pull request here:

https://github.com/arduino/Arduino/pull/1183

a precompiled version with a fix is here:

https://github.com/cmaglie/Arduino/blob/06ee62afc66e9917b3dc38bcf496de0e1a3d7d7d
/hardware/arduino/bootloaders/stk500v2/stk500boot_v2_mega2560.hex

Can someone test this one?

Original comment by c.mag...@bug.st on 24 Jan 2013 at 2:43

GoogleCodeExporter commented 9 years ago

Original comment by c.mag...@arduino.cc on 11 Mar 2013 at 11:59