cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to read program stored in STM32F103C8T6 ?

Math86
Associate II

Hello everyone,

I bought a tool that uses a STM32F103C8T6 with a program on it to transmit some CAN data. I would like to read the program that is currently on the tool and edit it.

Is it feasible ? Or is the memory protected ?

Thanks in advance for your help ! ��

21 REPLIES 21
TDK
Guru

I would expect most companies selling commercial tools to enable read protection.

If read protection is off, you can read the compiled assembly code, but not the source code. Editing the program to do something useful would require a significant technical ability and time investment.

If you feel a post has answered your question, please click "Accept as Solution".
Math86
Associate II

Thanks for the quick and detailed answer.

I'll try it out and see if I can get something. Do you know where I can find some info on how to connect to the STM32F103 and check if the read protection is activated ? The PCB I have provides some pins that are connected to VDD_1, PA09, PA10, PA13 and PA14. I also have a "FT232RL FTDI Mini USB to TTL Serial Converter Adapter Module" that I bought for that purpose.

Kind regards

If you need to ask that question, it suggests that you're not in a position to do much with the code if you do manage to read it.

You would need to connect to the microcontroller's SWD/JTAG Debug port using an ST-Link or similar debug probe.

Math86
Associate II

Indeed I don't have much experience with micro processors. I do have a bit of experience with coding tho and I'm pretty sure the code is very simple (only a few lines). So I'll give shot, nothing to lose anyway.

App Note AN2606 would cover modes of connectivity, PA9/PA10 would provide access to the boot loader

STM32 Cube Programmer can use that via UART/COM mode

PA13/PA14 would require a ST-LINK pod, and STM32 Cube Programmer could use that also

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

I don't think the code is in the form you're imagining, a few lines becomes a needle in the haystack.

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

If what you want to do is read what is written inside the microcontroller so you can change some code.

Short answer no.

Long answer:

What the microcontroller memory contains is the already compiled machine code (unless youre using micropython or some other satanic scripting engine).

This means youre just going to be able to read BIP BUP BIP, maybe some static strings. Reverse engineering that would be VEEERY HARD.

0693W00000BZofNQAT.png

we dont need to firmware by ourselves, lets talk

"I'm pretty sure the code is very simple (only a few lines)"

In that case, probably easier to just write it from scratch to do what you want.

Thanks a lot for the help !