1

I have a CNC router table that came into my local makerspace. The board looks like it has some standard parts, but also has some parts I don't recognize. At the heart of it is an Arduino Uno. I would like to get the code from the UNO, as a back up. I will have to do testing on this board, but I don't want to overwrite something I don't have a back up of.

is there a way to get the firmware off of the arduino, without having the ino files that generated it?

(This is a standard function on many other platforms such as PIC, I just don't know how to do it in Arudino. I am assuming the functionality also exists.)

5
  • cool story bro, show me.
    – j0h
    Jul 10 at 0:19
  • the hex file is the code. your MCU runs. if I had the hex file, I wouldnt need the source code, I could upload it to the MCU. I can do that with avrdude, or whatever, Im sure arduno code can do it too.
    – j0h
    Jul 10 at 0:22
  • here is some talk about it electronics.stackexchange.com/questions/61079/…
    – jsotola
    Jul 10 at 0:30
  • lol nice. Here is some talk about it, no solution, and a link to a 404d page. I think I almost have it figured out one my own, though. ... I think I can get avrdude to do it.
    – j0h
    Jul 10 at 0:36
  • yes, avrdude is the program ... there should be command line help that may include an example
    – jsotola
    Jul 10 at 0:47
4

Cool I got it using avrdude. $ avrdude -c arduino -P /dev/ttyUSB0 -b 9600 -p m328p -U flash:r:CNCArdunio.hex:i

> -c the platform (basically)
> -P the port where your harware is. 
> -b the baudrate.
> -p the chip architecture.
> -U momory type flash  :r option to read to file  :i option to format into Intel HEX.

caveats.Upon closer inspection this is either a very early model UNO, or a cheap clone. It comes up at /dev/ttyUSB0, and required that I press the reset button shortly before sending the avrdude command, else it resulted in

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
2
  • I just thought of another way to do it, using an ardunio as an ISP, (in circiut programmer? wut?) but Im not sure it would work right using this board, and my other authentic Ardunio boards. and it wouldnt give you a file, you would simply make a clone.
    – j0h
    Jul 10 at 1:14
  • 1
    You might also need to read the mcu's eeprom using the same command, but with eeprom:r:eeprom.eep:i (I believe).
    – Sim Son
    Jul 10 at 13:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.