Go Down

Topic: can an arduino code be retreveid ? (Read 683 times) previous topic - next topic

Hamad

ok so heres the qustion if you upload the software to microcontroller,
can you possibly get the code back from the microcontroller if you lost it and if so what should i do ??

am a nooby in programing,  am only shooting in the dark here but isnt it possible to get the same code back from memory ? if so what should i do ?

madworm

Well, you can download the machine code and save it to a hexfile. It can be used to program other chips of the same kind.

But I assume you wanted to get the C-code back, can't be done.
Mr. Backup is your friend.

If you should be using linux or a mac, I suggest using some sort of version control tools. I personally use GIT to keep my code in order including a full history of changes.
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

Hamad

aww i was hoping theres was a way to get the code back.

you were right i didnt back up, i'll search for GIT. would you mind telling me how to get the hex files out of the chip.  :'(

madworm

You'll need to run something like this:

Code: [Select]
avrdude -b 19200 -c stk500 -p m168 -P /dev/ttyUSB0 -U flash:r:saved.hex:i -vvv

This assumes you at an ATmega168 chip (m168) and have it connected to /dev/ttyUSB0.

Most likely you'll need to make some adjustments.
• Upload doesn't work? Do a loop-back test.
• There's absolutely NO excuse for not having an ISP!
• Your AVR needs a brain surgery? Use the online FUSE calculator.
My projects: RGB LED matrix, RGB LED ring, various ATtiny gadgets...
• Microsoft is not the answer. It is the question, and the answer is NO!

MarkT

Quote
aww i was hoping theres was a way to get the code back.



Google 'avr decompiler' - there seem to be some tools out there.
[ I won't respond to messages, use the forum please ]


Go Up