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.

30 REPLIES 30

@BTay.1​  "It is a task given to me by my boss"

And you're getting him to help you with this, and/or getting (an) experienced colleague(s) to help?

"a header on the PCB, for which I don't know which pins are TCK,TMS,TDO,TDI"

ARM defines some standards for this - is it a standard header?

https://developer.arm.com/documentation/ka001776/latest

As @Community member​ said, most STM32 use SWD - which is just 2 lines (or, preferably, 3 - to include Reset).

"part marking: STM32F103T8U77BA7E93PHL739"

That's plenty of information to be able to identify it sufficiently for this purpose:

https://www.st.com/en/microcontrollers-microprocessors/stm32f103t8.html

BTay.1
Associate II

Hey JW, thanks for your reply and I am sorry for my late response. Those pins you highlighted correspond to the VFQFPN36 package, but the one I see on the board has 36 physical legs, meaning it can only be a LQFP package, but the min. number of legs for the LQFP packages stated on the datasheet goes only to 48. This is why I am confused as to which of the 36 pins correspond to the JTAG lines.

>>This is why I am confused as to which of the 36 pins correspond to the JTAG lines.

You're overthinking this, it's not that complicated.

STM32F103T8U7

https://www.mouser.com/ProductDetail/STMicroelectronics/STM32F103T8U7?qs=Fn3VdHBzkclnP9j4Vr0IVA%3D%3D

UFQFPN-36

https://www.mouser.com/datasheet/2/389/stm32f103c8-1851025.pdf

0693W00000Nt73YQAR.jpgPA13 JTMS/SWDIO

PA14 JTCK/SWCLK

PA15 JTDI

PB3 SWO/TDO

PB4 JNTRST

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BTay.1
Associate II

The chip I have has pins sticking out, so it's definitely not this package

Then perhaps you've misread the part#

The pins on 36-pin packages are not randomly assigned.

Trace the pins to your supposed debug header.

Look at what the powers and grounds are connecting too.

Look at the pins the crystals attach.

If these things mismatch, perhaps a different part.

But you've provided no pictures. Or any connectivity details on any of the pins.

Probe the identified pins against the header.

Look at the board traces.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
BTay.1
Associate II

0693W00000Nt7YJQAZ.jpgSo as you can see it is 36 legs, 9 legs on each side, and the 4 pin header (i believe it's use for programming). Tried probing but didnt have much success so far.

@BTay.1​ "the 4 pin header (i believe it's use for programming)"

You "believe"?

What have you done to confirm that belief?

If it's only 4 pins, unlikely that it'll be JTAG.

But it might be a UART or other bootloader...

"Tried probing but didnt have much success so far"

you're the only one that has the board - so nobody can help you with that.

I'd start by getting some decent high-resolution images of both sides of the board.

You may need to invest in a better camera (or a camera with better macro capability).

Sometimes a flatbed scanner can be good for this - if other components aren't too tall.

Use an image-processing tool to reverse the image of the back side of the board - so that it corresponds to the front image.

Then you can trace the tracks, and see where vias join layers...

Have you tried putting images of the board and/or the complete unit into Google Image Search?

Andrew Neil
Evangelist III

@BTay.1​ "part marking: STM32F103T8U77BA7E93PHL739"

The datasheet for that says:

0693W00000Nt7h4QAB.png 

So that part number is for either a VFQFPN or a UFQFPN:

0693W00000Nt7hTQAR.png0693W00000Nt7hYQAR.png 

Neither of those matches the image you posted so, as @Community member​ said, it looks like you've mis-read the part number.

Or it's a fake part ...

EDIT

@Piranha​  and @Community member​  have pointed out that it is (or could be) a QFN, but with PCB pads that would also take a QFP.

Power, ground, and crystal seem to be well situated.

You're telling me you can't probe out two signals, or add some flying leads to SWDIO/SWCLK?

The photography is pretty poor, something crisp and in-focus would be good, but still are we sure this is pinned, and not just using very long, QFP compatible, land patterns and a boat loads of solder?

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