Pages: [1]   Go Down
Author Topic: download lost program  (Read 2215 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I made a goofy "new guy" mistake.  I got busy writing a program and had a fair amount of work put into it and didn't save the sketch.  I did have it uploaded onto my Arduino Mega and it is still there running.  How can I download that sketch from the board to my computer?  I thought maybe the EEPROM read would do that but I get the error

In file included from C:\Users\Brad Dickerson\Desktop\New Folder (3)\Arduino\arduino-0021\libraries\EEPROM\EEPROM.cpp:24:
c:/users/brad dickerson/desktop/new folder (3)/arduino/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h: In function 'void eeprom_read_block(void*, const void*, size_t)':
c:/users/brad dickerson/desktop/new folder (3)/arduino/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/avr/eeprom.h:290: error: ISO C++ forbids incrementing a pointer of type 'void*'

etc... 

Which I have no idea what it means
I really don't want to start over it possible.
 please help
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26442
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What gets downloaded into the arduino is the compiled HEX output file that the uC runs - if you read it back, it is not something you can edit anymore to make changes to.
You need to get in the habit of pressing Save before you compile & download.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Aurora, IL USA
Offline Offline
Jr. Member
**
Karma: 3
Posts: 56
Felix qui potuit rerum cognoscere causas.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Exactly what CrossRoads said: you're going to need to start over.

(A hobby of mine involves reverse-engineering embedded code in certain vehicle engine control units. Yes, technically, the code that you wrote is still there, but it's not going to look like anything you'll want to modify, unless assembly is something you find exciting. You'll actually have better luck trying to recover/"undelete" the relevant file.)
Logged

-Ed
Felix qui potuit rerum cognoscere causas.

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 126
Posts: 8472
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Look on the bright side, it's good practice to trash version 1 (and even version 2) and rewrite as you do a lot better next time around.

While I've never done this deliberately I did lose a few weeks of work on a project once, but the rewrite was MUCH better code.

Oh, and get used to using ^S and frequent backups smiley
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well that's thoroughly crap! It wasn't too bad. I salvaged a piece of the code from another file but I still have to rewrite the rest.

I appreciate the help and the quick response.

Thanks guys.  smiley
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a chance that in the temp directory there is a copy of the .pde file except its extension is .cpp

Such a directory looks like - C:\Users\Rob\AppData\Local\Temp\build2750385992883239260.tmp - on a windows platform. As said the source file is renamed to .cpp and some headers are added but most of the code could be there.

hopes this helps,

Rob
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: [1]   Go Up
Jump to: