Topics

Download from Arduino

Mike Reed
 

 Howdy
 I have a question that I have not seen an answer for.
 Can an existing program be downloaded from an Arduino and / or it's variants?
 I have several radios I have bought or have been given from others and I would like to know how or what they were programmed with. I have been learning programming of Arduinos, so I know how to get it in. Can it be removed?
 Thanks for the help
 73
 Mike - N7ZEF

Reed N
 

Sometimes. If the processor is not locked, then yes. However, on some processors with certain settings, trying to read them will automatically cause them to memory wipe themselves, so be careful. For AVR processors, and in particular for actual Arduinos, you'll want to use a program like AVRDUDE to read the flash (avrdude -p m328 -c stk500 -U flash:r:"flash.bin":r). However, this only gives you the binary code - it doesn't give you C/C++ files used to generate it. You can then use a decompiler to try and get a human-readable version of the code, but that requires a lot of work. Or you can easily translate to assembly and then just annotate there, but  if you're just starting, then all of these options are probably going to require a LOT of learning really quickly.


Reed

Dennis Zabawa
 

What is loaded onto the Arduino is compiled and linked machine code.  If if you have a disassembler for the Arduino ARM instruction set, you could get the machine code into assembly language but not back to the C++ code.

Don, ND6T
 

A potent argument for displaying file name and version information on a "splash" screen. 73, Don

Dean Souleles
 

Hi Mike,

The good gentlemen's answers are correct, technically, but I suspect the real answer to your question is "No".  There is no practical way to unload a program from the Arduino and learn how it is programmed.  For that you would need the source code.  Fortunately for us, nearly every Arduino Sketch mentioned on this board in 100% open source and you can download the source files and load them directly into your Arduino IDE.

Ubitx.net is a good place to start - check the links on the right hand side of the page - otherwise send a note to the author.

73,
Dean
KK4DAS


Mike Reed
 

I appreciate all the reply's to my question. And the confirmation to my suspicions, that it cannot be done by someone new to this like I am. That would explain why I never found an answer.
 It would be like trying to reverse a Windows engineer a Windows program.
 Guess I will need to be careful in what I do and hope it don't get smoked...
 Thanks
 73
 Mike - N7ZEF

Ashhar Farhan
 

Mike,
It is often easier to just write the program from scratch. Much easier. Almost all the tricks of coding Arduino are out in the open source.
- f

On Thu 20 Feb, 2020, 8:59 AM Mike Reed, <n7zef@...> wrote:
I appreciate all the reply's to my question. And the confirmation to my suspicions, that it cannot be done by someone new to this like I am. That would explain why I never found an answer.
 It would be like trying to reverse a Windows engineer a Windows program.
 Guess I will need to be careful in what I do and hope it don't get smoked...
 Thanks
 73
 Mike - N7ZEF

Arv Evans
 

Mike  N7ZEF

Seconding Farhan's comments...programming an Arduino from scratch is really easy. 
The Arduino IDE takes care of all the messy details like linking, loading, etc. 
Code can be written simply or complex.  When beginning you only need to use
conventional K&R C language, with a few routines from the Arduino reference pages.
After gaining some experience you can start to include more C++ constructs.  Several
of the C-language Gods reside on this group to provide help if you get stuck on
something. 

Arv  K7HKL
_._




On Wed, Feb 19, 2020 at 9:29 PM Ashhar Farhan <farhanbox@...> wrote:
Mike,
It is often easier to just write the program from scratch. Much easier. Almost all the tricks of coding Arduino are out in the open source.
- f

On Thu 20 Feb, 2020, 8:59 AM Mike Reed, <n7zef@...> wrote:
I appreciate all the reply's to my question. And the confirmation to my suspicions, that it cannot be done by someone new to this like I am. That would explain why I never found an answer.
 It would be like trying to reverse a Windows engineer a Windows program.
 Guess I will need to be careful in what I do and hope it don't get smoked...
 Thanks
 73
 Mike - N7ZEF

Dave New, N8SBE
 

Mike,

I use the 'spare Arduino' approach.

Order this:


You get a 'three pack' of Arduino Nanos with the appropriate CH340 micro-USB interface, with the header pins included loose, so you can choose to solder them (or not) on the top or bottom of the board, to suit the application.  They are packed in cute little 'chiclet' boxes (if you remember Chiclets).

When I ordered this a few weeks ago, the price was only USD$10.  When I checked it a week or so ago, it had jumped to USD$14.  Now I see ELEGOO is asking USD$18.  At that rate, I should have invested in a crate of them, and sold them for an almost 100% profit Laughing

Anyway, with spare Nanos in hand, you can experiment freely with flashing a spare Nano and swapping it in the radio, and if everything goes pear-shaped, you can just plug the original one back in.  Note that you will need to do a calibration (screen, LO, BFO) when you flash a new module.  You should probably do that anyway, since every board I've ever got from HFsigs was not calibrated to my satisfaction.  WRITE DOWN THE LO and BFO NUMBERS WHEN YOU CALIBRATE. Once you do, you can just dial them in when you re-flash and you'll be all set.

Have fun, and 73,

-- Dave, N8SBE

-------- Original Message --------
Subject: Re: [BITX20] Download from Arduino
From: "Ashhar Farhan" <farhanbox@...>
Date: Wed, February 19, 2020 11:29 pm
To: BITX20@groups.io

Mike,
It is often easier to just write the program from scratch. Much easier. Almost all the tricks of coding Arduino are out in the open source.
- f

On Thu 20 Feb, 2020, 8:59 AM Mike Reed, <n7zef@...> wrote:
I appreciate all the reply's to my question. And the confirmation to my suspicions, that it cannot be done by someone new to this like I am. That would explain why I never found an answer.
 It would be like trying to reverse a Windows engineer a Windows program.
 Guess I will need to be careful in what I do and hope it don't get smoked...
 Thanks
 73
 Mike - N7ZEF

Jack, W8TEE
 

Amazon (search B07DMGM5FT) has 4 for $13. Don't be afraid of the CH340 USB driver. That driver is a free download and the IDE can sense of the chip has the "old" bootloader in it and you just select the old bootloader in the Arduino IDE (i.e., Tools --> Bootloader). AliExpress has them for about $2.50 each (32866959979).

Jack, W8TEE

On Thursday, February 20, 2020, 1:40:31 PM EST, Dave New, N8SBE <n8sbe@...> wrote:


Mike,

I use the 'spare Arduino' approach.

Order this:


You get a 'three pack' of Arduino Nanos with the appropriate CH340 micro-USB interface, with the header pins included loose, so you can choose to solder them (or not) on the top or bottom of the board, to suit the application.  They are packed in cute little 'chiclet' boxes (if you remember Chiclets).

When I ordered this a few weeks ago, the price was only USD$10.  When I checked it a week or so ago, it had jumped to USD$14.  Now I see ELEGOO is asking USD$18.  At that rate, I should have invested in a crate of them, and sold them for an almost 100% profit Laughing

Anyway, with spare Nanos in hand, you can experiment freely with flashing a spare Nano and swapping it in the radio, and if everything goes pear-shaped, you can just plug the original one back in.  Note that you will need to do a calibration (screen, LO, BFO) when you flash a new module.  You should probably do that anyway, since every board I've ever got from HFsigs was not calibrated to my satisfaction.  WRITE DOWN THE LO and BFO NUMBERS WHEN YOU CALIBRATE. Once you do, you can just dial them in when you re-flash and you'll be all set.

Have fun, and 73,

-- Dave, N8SBE
-------- Original Message --------
Subject: Re: [BITX20] Download from Arduino
From: "Ashhar Farhan" <farhanbox@...>
Date: Wed, February 19, 2020 11:29 pm
To: BITX20@groups.io

Mike,
It is often easier to just write the program from scratch. Much easier. Almost all the tricks of coding Arduino are out in the open source.
- f

On Thu 20 Feb, 2020, 8:59 AM Mike Reed, <n7zef@...> wrote:
I appreciate all the reply's to my question. And the confirmation to my suspicions, that it cannot be done by someone new to this like I am. That would explain why I never found an answer.
 It would be like trying to reverse a Windows engineer a Windows program.
 Guess I will need to be careful in what I do and hope it don't get smoked...
 Thanks
 73
 Mike - N7ZEF

--
Jack, W8TEE