Atmega Chip Programmer by Nick Gammon hangs part way through

Hi - I have programmed an Arduino Uno with Nick G's Atmega Chip Programmer and have used it to replace the bootloader on four boards containing Atmega2560 micros. This was to get around watch-dog timer issues. However, a fifth board, different from the others but also having a 2560, hangs part way through programming. Here is the Serial output from Nick's program:

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Mar 29 2018 at 10:00:15 with Arduino IDE 156.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xFF
Clock calibration = 0x59
Bootloader address = 0x3E000
Bootloader length = 7474 bytes.
Type 'Q' to quit, 'V' to verify, or 'G' to program the chip with the bootloader ...

(I entered 'G')

Erasing chip ...
Writing bootloader ...
Committing page starting at 0x3E000
Committing page starting at 0x3E100
Committing page starting at 0x3E200
Committing page starting at 0x3E300
Committing page starting at 0x3E400

This board was working properly before attempting to replace the bootloader. Any ideas how I might overcome this problem?

Try the Arduino IDE's regular Tools > Burn Bootloader process. I'm sure that Chip Programmer sketch is useful in specialized applications, such as when you need a standalone programmer that doesn't need to be attached to a computer but for normal bootloader flashing it's really not a good choice.

Hi pert - thank you for your advice. I will investigate further, but I chose this bootloader as it does not have the watdog issues associated with earlier bootloaders and the Atmega 2560. I have now used this bootloader to program seven boards, with only the one failure. I wonder if there is a marginal timing issue, and slowing something slightly will fix the problem? - Peter

The Arduino/Genuino Mega 2560 bootloader included with all recent versions of the Arduino IDE does not have the watchdog bug.

Even better is the ATmega2560 bootloader included with MegaCore:

This bootloader fits into the minimum 1 kB boot section, rather than the 8 kB boot section of the stock Arduino bootloader, freeing up 7 kB of program memory. It also has a feature that allows you to program flash memory from the application.
MegaCore can be easily installed following the instructions at the link above and then you can use the standard Tools > Burn Bootloader process to flash the bootloader to your microcontroller.

Thanks Pert - I will investigate the MegaCore option - best regards - Peter