I have an already programmed STM32MCU. But I don't have the source code. I understand it is difficult to get the source code from the IC. I have heard some people can get the binary file from the IC which I can flash to another Arduino. Any guide or material will be helpful. I tried my luck with google. but didn't find any good resources on this matter.
-
you can probably get the hex file from the mcu you are using, and use a decompiler to get the functions. Tirdad is right, that the code likely wont work on different architectures directly, but once you have the hex file you can start porting functions.– j0hSep 25, 2020 at 22:41
1 Answer
you can download the flash content using a ST-Link probe and STM32CubeProg tool. you can't flash it to just "any" arduino board; it must be the exact same chip or same family MCU, if the IOs and peripherals used are the same.
-
There's also the command-line tool,
STM32_Programmer_CLI
, which can be used. I describe installing it here: arduino.stackexchange.com/a/77432/7727. Check the help menu, UM2237, or help menu at the command-line (STM32_Programmer_CLI -h
), for more command info on which commands to use. Aug 26, 2020 at 23:22