Go Down

Topic: upload sketch from arduino board to ide (Read 2 times) previous topic - next topic

kenkoknz

Hi, Can anyone advise me how to upload sketch from arduino board to the ide? Sometimes it would be useful to upload the code from the arduino board to ide to see what sketch is programed on the chip.
Thanks,
K  

retrolefty

#1
Jul 21, 2010, 03:02 am Last Edit: Jul 21, 2010, 03:27 am by retrolefty Reason: 1
Quote
Hi, Can anyone advise me how to upload sketch from arduino board to the ide? Sometimes it would be useful to upload the code from the arduino board to ide to see what sketch is programed on the chip.


Nope, doesn't work that way. You have to save a copy of your C/C++ sketch program away somewhere as a back up of the source code.

A 'trick' I use sometimes is to add code to send the sketch name out the serial port in the setup portion of the sketch so I can see what was last loaded by opening the IDE serial monitor.

Lefty

kenkoknz

thanks lefty,
i was thinking some 'smarties' out there would have worked out a program to initiate a program memory dump of the the chip, and a 'reverse' complier to change the machine code back to source code - maybe doable?
k

retrolefty

Quote
i was thinking some 'smarties' out there would have worked out a program to initiate a program memory dump of the the chip, and a 'reverse' complier to change the machine code back to source code - maybe doable?


In theory, possibly, but then again maybe not practical? The problem is that the 'reverse complier' part would be a task only a software god might take on, with little return on the time investment made.  ;)

Lefty

WanaGo

This type of 'Upload' is common to PLC's (Programmable Logic Controllers - Industrial control systems basically), however isnt done by reverse compiling the code.

The code is written to flash like normal, but the uncompiled code is also able to be uploaded to memory and saved as a file basically. Then when an upload is done, the file is basically downloaded off the processor and opened with the editor.

Most likely not possible with AVR's as the memory may be too small and most likely wouldnt support this, however could most likely be done if you attached a SD sheild (or the like) - however the IDE would need to be modified in order to get the automated upload of the uncompiled code to SD, most likely.

Something to ponder on.

I am an Automation Engineer by trade, and use PLC's everyday, and this feature is very appealing especially if your backup is lost or you 'inherit' a PLC which was programmed some time ago and you have no source code.

Go Up