Arduino – How to read the current program from an Arduino

arduino

I acquired an Arduino PCB with an ATmega2560, already programmed with the Arduino bootloader and some program. I do have the sketch, but before fiddling with it, I'd like to backup the current binary that is in the controller. As most Arduinos, it's connected to the PC using an USB-to-serial converter connected to TX0 and RX0 and there is no ISP interface.

Apparently there is code for reading in the Arduino bootloader, but I have no idea which tool to use to access it as there is no menu item in the Arduino IDE.

What software do I need to read the program from the Arduino?

Best Answer

The Arduino bootloader is a variant of the original STK500 protocol (1.x). The character 't' (ASCII 0x74) is the "Read Page" command. So perhaps it is possible to pull the program out through the serial port via the bootloader using AVRDUDE... But at best I reckon it will take some fancy timing to pull it off.