Can you reverse compile from UNO?

We have a programmed UNO done by a summer grad student for a 3D printer. Something has went wrong with the program, and we need to look at it. The student is gone, program is stored somewhere unknown, and the only way to get it is likely to pull it off the UNO. Is this possible?

Not really, no.

It would be far, far easier to contact the student.

ORNL: We have a programmed UNO done by a summer grad student for a 3D printer. Something has went wrong with the program, and we need to look at it. The student is gone, program is stored somewhere unknown, and the only way to get it is likely to pull it off the UNO. Is this possible?

You can download the same data from the UNO that you have uploaded before: The HEX file as the compiled and machine executable program.

But you cannot download the source code from the UNO, as the source code is only stored on the PC.

I assume you have a dedicated PC on the printer. I suggest you put the Arduino IDE on that computer and keep the source close to the UNO.

jurs: You can download the same data from the UNO that you have uploaded before: The HEX file as the compiled and machine executable program.

It might help OP if you could point him in the right direction (e.g. a link) how one can read the flash memory of the Uno. After that it can br didassrmbled and / or decompiled.

Please put scare quotes around "de-compiled." You are giving false hope. With gcc optimization entire functions and variables might have been removed. You can get compilable C out, but it will not resemble your source code at all - though it might be enough to debug the issue.

jurs: You can download the same data from the UNO that you have uploaded before: The HEX file as the compiled and machine executable program.

But you cannot download the source code from the UNO, as the source code is only stored on the PC.

How exactly would you do this?

ORNL:
How exactly would you do this?

Every Arduino-IDE comes along with several command line programs/tools, one of them is “avrdude

Besides of that you need an “ISP programmer”.

You can then use the avrdude tool from the command line along with your ISP programmer to retrieve the HEX file from the Atmega328.

Reading hex files from Arduino-boards is not supported by the Arduino-IDE.
There is no point-and-click support or a graphical user interface for doing so.

If you are on the low level of programming, you are at the level of command line tools like avrdude.exe and cryptic command line parameters.

But why do you want to have the hex file after the source code is not available?

The only use of reading a hex file from an Arduino board would be: You can use the same HEX file to load the exactly same program to another Arduino board.

If you want to have the source code to change anything in the program, you MUST ask the one who has the source code!

If you want to have the source code to change anything in the program, you MUST ask the one who has the source code!

Imagine breaking a bunch of eggs and making a souffle, and then baking it. It is the souffle that is on the Arduino, and what you need is the carton of eggs. It is easy to make a souffle from a carton of eggs. It is a bit more difficult to make a carton of eggs from a souffle.