cancel
Showing results for 
Search instead for 
Did you mean: 

Extraction of bin file from microcontroller

BTay.1
Associate II

Hey, sorry, I am pretty new to this. I have a rather basic question. I took apart a module that I have, within which there is STM32 microcontroller (part marking: STM32F103T8U77BA7E93PHL739). I want to know if it's possible to use the IDE to extract the existing bin file in the microcontroller, via JTAG or some other method? Reason being I have my own bin file that I'd like to test, but in case I screw things up, I'd like to be able to restore the module back to its original condition by reinstating the original bin file into the microcontroller. So my plan is to extract the current contents of the microcontroller by reading back, store the bin file safely before i do any kind of experimentation so that at least the original condition can be restored. Hope my question is clear.

1 ACCEPTED SOLUTION

Accepted Solutions
Mike_ST
ST Employee

Hello please use STM32CubeProgrammer:

0693W00000NrG76QAF.jpg

View solution in original post

30 REPLIES 30

STM32 Cube Programmer should be able to Read and Save the memory content provided that the device isn't protected to prevent that.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III

@BTay.1​ "I am pretty new to this"

To what, exactly?

Mike_ST
ST Employee

Hello please use STM32CubeProgrammer:

0693W00000NrG76QAF.jpg

BTay.1
Associate II

Thank you for your assistance. I am pretty new to microcontrollers in general. My next question is, I have to connect to this microcontroller. I have no idea what part number it is exactly, as there was no design information or schematics given with this module that I am tasked to investigate. I spot that the microcontroller on the PCB has 36 legs, 9 on each side, which means it is some kind of LQFP36 package, but googling the part number yields no datasheets, the closest datasheet I could find only carries microcontrollers in LQFP48, 64 or 100, so clearly doesnt correspond to the part I have on the board.

There is a small 4-pin header next to the microcontroller, presumably it is the JTAG header, I need to figure out which pins in the header correspond to TMS, TCK, TDI, TDO, by probing with my multimeter. But first I need to know which of the 36 pins on my microcontroller correspond to TMS, TCK, TDI, TDO. This is where I am stuck for now.

I attach the datasheet I found.

There's a nonzero likelyhood that the mcu under question is locked, i.e. firmware cannot be read out.

I recommend you to experiment on some testing target first, a Nucleo or Disco board with a similar STM32 than is your target.

JW

BTay.1
Associate II

Hey JW,

Yes, I am aware, but without trying, I wouldn't know. I am only concerned about extracting the bin file from this particular microcontroller, and if it's not possible, then I won't even go down this route

@BTay.1​ "I am pretty new to microcontrollers in general"

Thanks.

Then, as @Community member​ suggested, I would also suggest that you spend some time gaining familiarity on a Nucleo, Discovery, and/or similar board(s) - rather than risk potentially wasting time on this "unknown" module and/or bricking it.

Reverse-engineering does require a good understanding of what you're looking at, and the tools you're using.

"I am tasked to investigate"

Tasked by who? Have you sought help from them?

They should understand that this is not really a beginner's task...

" I have no idea what part number it is exactly"

The STM32CubeProgrammer should be able to read the device ID and, thus, tell you what chip it is. Unless, of course, your unit is locked.

@Community member​ "There's a nonzero likelyhood that the mcu under question is locked"

Possibly significantly greater than zero?

BTay.1
Associate II

Hi Andrew,

It is a task given to me by my boss, I am an electrical engineer.

The STM32CubeProgrammer should be able to read the device ID and, thus, tell you what chip it is. Unless, of course, your unit is locked. -- In order to this, I need to connect the device to the STM32CubeProgrammer. The only way for me to do this is via a header on the PCB, for which I don't know which pins are TCK,TMS,TDO,TDI and I can only find out via manual probing. And in order to do manual probing I need to first find out which of the 36 pins on the microcontroller on the PCB correspond to TCK, TMS, TDO and TDI.

> which of the 36 pins on the microcontroller

While you can program some STM32 (including the 'F103) through full-fledged JTAG, most users use SWD which has two signals - SWDIO and SWCLK.

0693W00000NrJqEQAV.pngJW