cancel
Showing results for 
Search instead for 
Did you mean: 

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

ADiet.1
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

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.

View solution in original post

11 REPLIES 11
ADiet.1
Associate III

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

Sara BEN HADJ YAHYA
ST Employee

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
Associate III

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?

Sara BEN HADJ YAHYA
ST Employee

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
Associate III

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

Sara BEN HADJ YAHYA
ST Employee

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
Associate III

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

>>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 Venmo
Up vote any posts that you find helpful, it shows what's working..

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?