Pages: [1]   Go Down
Author Topic: can an arduino code be retreveid ?  (Read 660 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 ?
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

• 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!

0
Offline Offline
Newbie
*
Karma: 0
Posts: 18
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  :'(
Logged

"The old Europe"
Offline Offline
Edison Member
*
Karma: 1
Posts: 2005
Bootloaders suck!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You'll need to run something like this:

Code:
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.
Logged

• 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!

0
Online Online
Shannon Member
****
Karma: 215
Posts: 12463
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it still wont be C code, it will just be a dissembler listing
Logged


Pages: [1]   Go Up
Jump to: