how do I extract code from an Arduino?

I don't know if this is the correct place to ask, but i'll give it a shot.
now, on topic, last week I reinstalled my windows (from XP to 7) and I forgot to back up my sketches T_T . I haven't uploaded new code to my board since and I was hoping to find a way to read what's already on it and save it for future reference/modding. it's not something to die over, but it would be really handy to have (the code) - it has customized segments for calibration,debouncing,serial comm. and other things like that which are all around useful. it's not like i can't recreate them but why waste a good day or two for something that's already there.
oh and one more thing- since I don't want to upload any new code before i'm sure it's doomed, I don't see any problems with compatability so far... I haven't installed the USB-to-serial thing that came with the arduino environment. So i gotta ask- will I have any issues when i finally try to upload something and that thing isn't installed? preferably someone who's had experience with arduinos and windows 7.
thanks in advance, and sorry for my crappy expression, haven't had coffee all day and... my english might suck ::slight_smile:

valkir:

The best you could hope for is a 'disassembly' of the program code. This would give you an essentially uncommented version of the assembly language code that was created from the original C source code. I don't think it will be very helpful to you.

Don

dammit.... ok, what about compatability with windows 7 ? anything I should be aware of?

valkir:

I'm not the one to ask about that - I'm still using XP.

Don

I'm running Arduino 0017 under Windoze 7 - no problems whatsoever.
Yet.

It should be nice to get the code inside the arduino. Maybe an advanced dissasembler can get a pretty nice C code.

Anyone knows an easy way to do this?

eried:

It should be nice to get the code inside the arduino.

Isn't this already available? There's nothing else in there other than the bootloader and your sketch.

Maybe an advanced dissasembler can get a pretty nice C code.

You would need a "disCer". I don't think there's even a hard way to do that, much less an easy way!

Don

Obviously there are always many programs that will compiler to exactly the same executable. You will never get the original source back. But to find some program that compiles to the desired executable is theoretically possible. But obviously this would be a pretty useless exercise.

With regard to your lost code: you should think about backups. If you use a computer long enough chances are that you will have files that are somewhat important. Consider the price of an external harddrive and consider the value of your data. If the value of your data exceeds the cost for a drive then you should most definitely consider backups.
I use two external drives for rolling backups plus an USB stick for redundant storage of the most important high frequent changing data.

Cheers, Udo

I have my systems at home auto-backup every hour the diff-changes for a set of directories (/home) to an independent server (located in a different part of the house). The server also acts as a media/music/video repository. One of these days I am going to either add RAID, or back it up to another server.

I am very paranoid about my data; it only took took 3 consecutive crashes of the cheapo Apple 2e floppy drives in high-school (back in the 1980s), where I lost all of my code (and re-keyed it from printouts I had) before I started doing real and regular backups.

Nowadays, it should be a standard - but for some reason, for most people (and businesses!), it isn't.

Well, in Windows Vista or newer, NTFS backups automatically all your files, even the arduino sketches.

You just need to right click over the Arduino folder and click "Restore previous versions".

But if will be very nice to be able to recover the hex file from your arduino ;D

No machine I ever heard of will automatically backup anything for you. It may store previous versions. This is not a backup. A key differentiator of a backup is that it is physically separated from the primary data.

Cheers, Udo

Mac OS X and its Time Machine thingy?

Andrew

Yes of course time machine will do backups. But it will require an external drive or other machine for the backup. So a Mac running OS X needs the help of a backup program and some external hardware. Exactly what I stated.

Cheers. Udo