Silly question for everyone. I’m not a developer or a coder. I have a damaged brushless motor controller and I have found the fault to be the stm32 chip. I have removed it and replaced it with a new one. My problem is that I need to copy the data from a working chip to this new one. Can anyone offer advice or point me in the right direction.
Many thanks
James
Basically, if the stm32 is read protected, which its likely to be, then you will probably not be able to read the program inside it
You may be able to send it away to get it unlocked at a laboratory, ( for a large fee )
Reset pad links to pin 4 reset.
DIO pad links to pin 23 SWDIO.
TX pad links to pin 24 SWCLK.
RX pad links to pin 25
BT pad links to pin 31 Boot.
TLM pad links to pin 24 SWCLK.
PWM pad links to pin 26 SPI1_SCK.
Which of these do I need to read the chip. Because this is what looks like the manufacturer us to program with.
Many thanks again
James
James
James
James
how many pins?
can you post pictures of the board top & bottom ?
identify any connections? to the pcb and to components within the pcb
identify the power pins, 3v3, 5v & 0v
peruse a lot of data sheets
there are blc motor control app notes on st.com, sometime the sample circuits are used almost as is.
not sure if that helps at all, that’s the problem with a lack of info
stephen
I have specified the pins above and the exact chip I’m using. It look like they used pins 14 and 15 for uart communication. I have connected wires as per usb converter instruction but I can’t get demo software to see chip! 3v3 power to chip. Am I meant to power the chip while programming or is it powered via converter. Again sorry to be vague but very new to this.
James
Reset pad links to pin 4 reset.
DIO pad links to pin 23 SWDIO.
TX pad links to pin 24 SWCLK.
RX pad links to pin 25
BT pad links to pin 31 Boot.
TLM pad links to pin 24 SWCLK.
PWM pad links to pin 26 SPI1_SCK.
Which of these do I need to read the chip. Because this is what looks like the manufacturer us to program with.
Many thanks again
James
Many thanks
James
Pull pin Boot1 low
Connect TX and RX on your USB to Serial to PA9 and PA10
(Note you may need to swap the order if that does work for you as different USB to Serial have different labels on the pins)
See my video, which covers connecting a USB to Serial , and ignore the stuff about the Arduino IDE
https://www.youtube.com/watch?v=G_RF0a0hrak
Download STM’s “Flash Loader Demonstrator”
http://www.st.com/en/development-tools/ … stm32.html
Install and run that.
If it doesnt work first time, swap TX and RX around
If it still doesnt connect, try a few more times, with TX and RX around different ways, Because it doesnt always connect.
You can also try changing the speed settings if it doesnt connect, some USB to Serial adaptors work best slow some work better going faster
Once you have connected.
Make sure you don’t overwrite what’s in the chip, Look very carefully about what they call Uploading and what they call Downloading, as these can be counter-intuitive.
Reset pad links to pin 4 reset.
DIO pad links to pin 23 SWDIO.
TX pad links to pin 24 SWCLK.
RX pad links to pin 25
BT pad links to pin 31 Boot.
TLM pad links to pin 24 SWCLK.
PWM pad links to pin 26 SPI1_SCK.
Which of these do I need to read the chip. Because this is what looks like the manufacturer us to program with.
Many thanks again
James
Roger there is only boot0 on the stm32f051k6t6! I will try the tx and rx connections the other way around and see what happens.
Victor I will get my self a stlink and see where to go from there.
Many thanks to you both for your help. I will try both ideas and see what happens but I will be sure to post a reply how everything goes.
Thanks again
James
on the F103 boot1 controls whether the bootloader interacts with Flash or the RAM, but I guess the F051 bootloader will only interact with flash
Also, getting a cheap STLink e.g. eBay or Aliexpress is a good idea, they are not extensive, and work better than USB to Serial
While I applaud you for getting into SMT32 stuff and this is an interesting way to get into learning about it… But wouldnt it be easier to just buy a new motor? Or are these motors really expensive? I guess were not talking about your average PC case fan or hobby motor?
As for read protection, i didnt even know that was a thing… Good to be aware of it. So i can lock down some of my stuff if i decide to sell it so it doesnt get cloned by some Chinese factory :p Which is funny as Ill be getting a chinese factory to mass produce things if I did that :p
But also as some one else mentioned. Could you get the firmware hex file off the manufacturer? Maybe if you even asked really nicely in an email. They might give it to you
James

