I think I already know the answer to this question, but curiosity has made me ask it anyway!
Is it possible to 'upload' code from an Arduino, ie code written by someone else, so that it can be read, followed, understood, and copied...I presume this is called reverse engineering (?)
The specific problem which gave rise to this question is that I bought a GSM switch (often called a remote gate opener). It worked great, so I bought a second, but the second one did not accept text messages to operate the relays. Suspecting a bad copy of the code (it has an STM32 MCU) I imagined that I could upload the good software and copy it over to the bad GSM switch using the FTDI connection on its PCB.
Like I mentioned, I think the answer is obviously 'No', but would appreciate confirmation from those who know much more than I.
some processors have security bits to prevent that from being done for the reasons you mentioned.
but program memory can read on the Arduino processor and displayed thru the serial interface
while you can call this reverse engineering, it is certainly tedious. (better than looking on data on a bus) I describe trying to understand the design of code written in C with comments as reverse engineering.
Most microcontrollers, the STM32 line included, have an optional read protection feature. If this has been enabled, as is likely on any proprietary product, then one can not read back the flash using normal techniques.
If read protect is not enabled, then it should be possible to read back the flash. STM32 devices have native bootloader mode which can be entered by putting particular pins in the "DFU" state (see documentation for your particular device for "boot 0" & "boot 1" pins) or one can use the STLink programmer/debugger "SWD" mode.