user3596455
user3596455

Reputation: 351

Extract code (.hex or similar) from arduino Mega ADK on windows 8

I am a new user of Arduino boards. I have an Arduino mega ADK and I have to extract the code that was downloaded on it, because I don't find the source code. Is there a way to extract the code on Arduino board (such as the .hex file reading the flash memory) without having the source code ? I use Windows 8. Thank you very much. Enrico

Upvotes: 0

Views: 2657

Answers (2)

Ricardo Prieto
Ricardo Prieto

Reputation: 447

In Linux this worked for me in Mega 1280:

avrdude -p m1280 -c arduino -P /dev/ttyACM0 -b57600 -U flash:r:flash_backup_file.hex:r

change the baudrate and arduino type.

Upvotes: 0

Zen Skunkworx
Zen Skunkworx

Reputation: 167

Generally, you can find the hex file in a temp directory on your windows machine (assuming it is the machine used to build the code. From the official Arduino docuemntation:

"Only the parts of the library needed for your sketch are included in the final .hex file, reducing the size of most sketches. The .hex file is the final output of the compilation which is then uploaded to the board. During a "Verify" the .hex file is written to /tmp (on Mac and Linux) or \Documents and Settings\\Local Settings\Temp (on Windows). During upload, it's written to the applet sub-directory of the sketch directory (which you can open with the "Show Sketch Folder" item in the Sketch menu)."

In my experience, I had a bunch of randomly named directories in the location specified above and I had to sort them by date/time and find the one that had my hex file.

Hope that helps!

Upvotes: 0

Related Questions