Is it possible to download a sketch from an Ardino?

Hi, gang,

I have an Ardino Nano, that has a sketch that working fine. Problem is, I don't have the original sketch on my computer anymore.Most likely a result of one too many HD crashes over the years.

Is there a way to download the sketch from the ardunio into a file that then can be loaded into the IDE and start over, or am I SOL?

As the original sketch is not actually on the board, only the compiled binary file, the answer is no I am afraid

The sketch was compiled on your computer, and the resultant binary code was what was programmed into the Nano. The Nano never saw the sketch that you wrote; just the code that the compiler created from it.

For all practical purposes, you're up the creek. If you're determined enough, you can decompile the binary code after using avrdude to retrieve it, but it would take an inordinate amount of time, and the end result would still not be recognizable as your original sketch.

If the sketch is working fine and you never need to change it then you can extract the binary file from the Nano (classic at least) and transfer it, if necessary, to another Nano. As already implied, that is far from a C++ sketch which could be edited in the IDE but might be enough. Even that recovery option may not be available if certain fuse lock bits were set to prevent against exactly the type of copying described above.

It should be in your many backups, you know 3 copies, 2 different media, 1 off site.

1 Like

Thanks everyone!

I kinda figured that was going to be the case. But you know I had to ask.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.