Skip to main content
ADiet.1
Associate III
March 14, 2023
Solved

Error during flashing with STM32_Programmer_CLI.exe, and how to fix it.

  • March 14, 2023
  • 8 replies
  • 4245 views

On windows 10 I am using STM32_Programmer_CLI.exe (2.13.0) to flash bytes to memory using the following command line

but then I do so I get a very strange output:

ST-LINK SN : 53FF71065056705420540981
ST-LINK FW : V2J29S7
Voltage : 3.22V
SWD freq : 4000 KHz
Connect mode: Hot Plug
Reset mode : Software reset
Device ID : 0x447
Revision ID : Rev Z
Device name : STM32L07x/L08x/L010
Flash size : 128 KBytes
Device type : MCU
Device CPU : Cortex-M0+
BL Version : 0xB2
 
 
Downloading 8-bit data...
 
██████████████████████████████████████████████████ 100%
 
Error: Failed to download data! If it's a Flash memory, it may be not erased or protected
 
Downloading 8-bit data done successfully
 
Downloading 8-bit data...
 
██████████████████████████████████████████████████ 100%
Downloading 8-bit data done successfully
 
Verifying ...
Read progress:
██████████████████████████████████████████████████ 100%
Download verified successfully

Now has the flash succeeded or not? Because I get an error and then some green bars. How to get rid of this error?

Also, the command did NOT succeed. Checking with the UI version of the programmer at least I see that the address 0x08080000 has not been changed. How to fix this problem?

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello @ADiet.1​ ,

The part number is written on top of the MCU as shown in the picture below. Please check your board and send it to me.

0693W00000aJTSkQAO.jpgThe device that you referred to in your last comment is the STLink-V2 and it is a debugger and a programmer.

About the binary file, you can send it to me in private.

Thanks in advance,

Sara.

8 replies

ADiet.1
ADiet.1Author
Associate III
March 14, 2023

Maybe I just repeat this command until there is no "Error" in the output? Is that a viable solution?

ST Employee
March 15, 2023

Hello @ADiet.1​ ,

Thanks for sharing,

So, I tested the following command:

.\STM32_Programmer_CLI.exe -c port=SWD -w8 0x08080000 0xAA 0x00 0x00 0x00 0x00 0x00 -w8 0x08080C00 0x00 0x00 0x00 0x00 0x00 0x00 -v

And EEPROM1 was programmed successfully:

.\STM32_Programmer_CLI.exe -c port=SWD -w8 0x08080000 0xAA 0x00 0x00 0x00 0x00 0x00 -w8 0x08080C00 0x00 0x00 0x00 0x00 0x00 0x00 -v 
 -------------------------------------------------------------------
 STM32CubeProgrammer v2.13.0
 -------------------------------------------------------------------
 
ST-LINK SN : 36FF6A064B46323626410643
ST-LINK FW : V2J28S6
Board : --
Voltage : 3.26V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x447
Revision ID : Rev Z
Device name : STM32L07x/L08x/L010
Flash size : 192 KBytes
Device type : MCU
Device CPU : Cortex-M0+
BL Version : 0x41
 
 
Downloading 8-bit data...
 
██████████████████████████████████████████████████ 100%
Downloading 8-bit data done successfully
 
Downloading 8-bit data...
 
██████████████████████████████████████████████████ 100%
Downloading 8-bit data done successfully
 
Verifying ...
Read progress:
██████████████████████████████████████████████████ 100%
Download verified successfully
.\STM32_Programmer_CLI.exe -c port=SWD mode=NORMAL -r8 0x08080000 8
 -------------------------------------------------------------------
 STM32CubeProgrammer v2.13.0
 -------------------------------------------------------------------
 
ST-LINK SN : 36FF6A064B46323626410643
ST-LINK FW : V2J28S6
Board : --
Voltage : 3.26V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x447
Revision ID : Rev Z
Device name : STM32L07x/L08x/L010
Flash size : 192 KBytes
Device type : MCU
Device CPU : Cortex-M0+
BL Version : 0x41
 
0x08080000 : AA 00 00 00 00 00 00 00

Did you run the same command ?, if yes could you please share the Option Bytes configuration.

Otherwise, please share the used command.

Thanks in advance,

Sara.

ADiet.1
ADiet.1Author
Associate III
March 16, 2023

I use the following command for example:

./STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -w8 0x08080000 0xAA 0x00 0x00 0x00 0x00 0x00 -w8 0x08080C00 0x00 0x00 0x00 0x00 0x00 0x00 -v --halt

But when I repeat the same command it usually works. So not a big deal. Just have to use a while loop until it works ... But would be better of course if the stm tool would work ...

when I quickly repeat the same command it seems always to succeed. when I wait for like 20 seconds, it fails. But when I then repeat the command again within a second it works again. What is going on?

ST Employee
March 16, 2023

Hello @ADiet.1​ ,

Could you specify the full part number of your device, and if it's possible please send me your project for further check.

Thanks & best regards,

Sara.

ADiet.1
ADiet.1Author
Associate III
March 17, 2023

Hello, the number on the device is "B 2022 42". And what "project" do you mean?

ST Employee
March 17, 2023

Hello @ADiet.1​ ,

Sorry for the confusion, I meant the MCU part number, for example STM32L073VZT3.

For the project, I need the code that you loaded in your MCU (binary file) and also I need the option bytes configuration.

Thanks in advance,

Sara.

ADiet.1
ADiet.1Author
Associate III
March 21, 2023

Hello, the MCU part number might be STM32L07x/L08xL010 (if not please provide the way to get this number). I am not sure I can share the binary file, but the option byte configuration is as follows:

0693W00000aJQQ7QAO.png

Tesla DeLorean
Guru
March 21, 2023

>>if not please provide the way to get this number

It will be lasered on the top of the part, or in your BoM as a fully qualified part number

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
ADiet.1
ADiet.1Author
Associate III
March 22, 2023

I do not find a number. Just to be clear the device looks like the white device that is shown here: https://www.st.com/en/development-tools/st-link-v2.html. Also, what is a BoM?

ST Employee
March 22, 2023

Hello @ADiet.1​ ,

The part number is written on top of the MCU as shown in the picture below. Please check your board and send it to me.

0693W00000aJTSkQAO.jpgThe device that you referred to in your last comment is the STLink-V2 and it is a debugger and a programmer.

About the binary file, you can send it to me in private.

Thanks in advance,

Sara.

ADiet.1
ADiet.1Author
Associate III
March 22, 2023

Ah I see, - I cannot see that anymore as the chip is built into a housing. It is impossible to get this number. But as far as I know it is of type STM32L071.