cancel
Showing results for 
Search instead for 
Did you mean: 

ST Link V2 CLI not working for my STM32F413

JHeni
Associate II

Hey guys,

i'm currently struggeling with the STM32 CLI to programm my MCU.

For my (old) STM32F103 i did setup a script wich worked nicely. Going through the documentation a came uo with

ST-LINK_CLI.exe -c SN=xxxxxx SWD UR -TVolt -ME -P ../my_firmware.hex -V -Rst

https://www.st.com/content/ccc/resource/technical/document/user_manual/e6/10/d8/80/d6/1d/4a/f2/CD00262073.pdf/files/CD00262073.pdf/jcr:content/translations/en.CD00262073.pdf

(See Section 4)

However when i tried to use the same cmommand to flash my STM32F4 it does not work.

The error is

My gues is that the CLI is still looking for the old STM32F103 device. However there's no option to change the MCU type. Could you help me out, do you have any idea how to fix this?

1 ACCEPTED SOLUTION

Accepted Solutions
Alex R
Senior

Try updating the ST-LINK to the latest version (4.4.0.0). It might recognize newer devices.

View solution in original post

4 REPLIES 4
Alex R
Senior

The error message is not shown on you post. Would you be able to add it again?

Did you try using the JTAG instead of the SWD?

Did you try using the STM32 ST-LINK utility? You might get a more descriptive error message.

JHeni
Associate II

Sorry my bad. I thought i copied the error into my question:

Here it goes:

0690X000008i9JDQAY.png

When i excecute this cmd the MCU is restarted. So "connect under reset" seams to work.

I did try the same using ST Link. The ST Link tool works fine

0690X000008i9JNQAY.png

Output looks pretty much the same to be, except one is working and the other not. :(

As you said, i tried JTAG (with STM32 Link Utility) but this did not work. I'm not sure if SWD and JTAG are hardware compatible though ?!

Alex R
Senior

Try updating the ST-LINK to the latest version (4.4.0.0). It might recognize newer devices.

JHeni
Associate II

Thx that was indeed the right answer. After upgrading mit ST Link CLI the device was found.

Just FYI:

After that i had to face 2 additional problems

  1. "unable to open file" error. => I have been usiing ../my_firmware.hex to set the path. This did (for some reason) not work any more. Removing the ../ solved that problem
  2. The MCU was not restarted after Flashing. I replaced the -Rst with -HardRst. Now the MCU is restarted after a flash

Thx for your fast help 🙂