cancel
Showing results for 
Search instead for 
Did you mean: 

Need help to program an STM32F051K8.

GWilk
Associate II

I have an STM32F051K8 that I burned out on a Lumenier tx5gs vtx. It still transmits video but I cannot change channels. I thought it would be fun to try and replace it. Fortunately the 3.3v, GND, SWDIO, and SDCLK pins are all broken out on the board. After installing a new chip (and carefully verifying that it is installed correctly with no shorts, I am attempting to connect with an ST-Link V2.  I have the binary firmware from the manufacturer, but no matter what I try I cannot get the ST-Link utility to connect.  When JTAG is elected (whatever that means) it either says:

19:45:25 : Can not connect to target!

         If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.

         If you're trying to connect to a Discovery board, please select SWD mode from Target->Settings menu.

19:45:26 : Unknown target connected

or if SWD is selected I get the following (even when I select the lowest frequency):

19:46:24 : Can not connect to target!

         If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.

         If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.

19:46:47 : Can't reset the core

Once I put it into automatic mode and it flashed even though it said failed to connect. Now it just says waiting...

I don't know how it can flash without connecting. I have been able to program an STM32F405 in the past. Is this enough information for someone to tell me what I am doing wrong? I have tried virtually every setting on the ST-Link utility and the firmware says it is up to day on the V2.

4 REPLIES 4
GWilk
Associate II

Now it flashes again, but still doesn't seem operate the board.

19:56:30 : Starting Automatic Mode...

19:56:30 : Waiting for device N° 1...

19:56:39 : Can not connect to target!

         If you're trying to connect to an STM32W1xx device, please select Normal or HotPlug mode from Target->Settings menu.

         If you're trying to connect to a low frequency application , please select a lower SWD Frequency mode from Target->Settings menu.

19:56:39 : Can't reset the core

19:56:39 : Flash programming:

19:57:38 : Memory programmed in 57s and 453ms.

19:57:38 : Please disconnect device N° 1...

Do I even need to connect to it? How can it flash without connecting? If the VTX board doesn't work after flashing is it likely that something else is burned out or am I just missing something?

Do I need to do something with the Boot0 pin?

GWilk
Associate II

I was never able to connect. I tried connecting RST but still no luck. However I did find a hex file with a bootloader that seemed to flash okay and now the board works.

Glad you got things working. Did you end up connecting via the USART?

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

I don't know. It was through the ST-Link-Utility. Is SWD USART? Also it never really connected. I got the same message that it couldn't connect nor reset the core, etc. but somehow it still flashed. I need to spend some time studying AN2606. I am not even sure what a bootloader is I just know you need it to flash. I got help from the manufacturer as far as giving me the *.hex file and telling me that the *.bin file didn't have a bootloader. What resources would you suggest if I want to learn all this stuff? I am considering finding a career as an electronic technician (I have a mechanical engineering degree but for various complicated reasons it is time to for me to move on, and I seem to enjoy the repair, programming, troubleshooting aspect of electronics).