cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use the STM32CubeProgrammer windows executable to read a memory area without the device resetting?

ADiet.1
Associate III

I have been trying to read a memory area as follows on windows power shell:

.\STM32_Programmer_CLI.exe -c port=SWD -r8 0x08080000 8 -r8 0x08080C00 8

but that triggers a reset of the device. I do not want a device reset, I just want to read the memory as specified. How to do that?

23 REPLIES 23

Here is the output:

PS C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>  ./STM32_Programmer_CLI.exe -c port=SWD  -e all
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.13.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF71065056705420540981
ST-LINK FW  : V2J29S7
Board       : --
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  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : 0xB2
 
 
Mass erase ...
 
Mass erase successfully achieved
PS C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>  ./STM32_Programmer_CLI.exe -c port=SWD  mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.13.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF71065056705420540981
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.21V
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  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : 0xB2
 
0x08080000 : 00 00 00 00 00 00 00 00
 
0x08080C00 : 00 00 00 00 00 00 00 00
 
PS C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>  ./STM32_Programmer_CLI.exe -c port=SWD  mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.13.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF71065056705420540981
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.20V
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
 
0x08080000 : 00 00 00 00 00 00 00 00
 
0x08080C00 : 00 00 00 00 00 00 00 00

My guess is that this is related to the dual-bank operation and its related flags (UFB maybe?).

With hot-plug, the running program may switch the mapping without knowledge of the programmer, and then it's always questionable, how far the programmer/debugger should force its settings to the application.

JW

Thanks for sharing @ADiet.1​ !

Now with the flash erased, try to write data in EEPROM (starting from 0x08080000), and verify if the issue persists (you can use the -w32 option via CLI)

Then, visualize the EEPROM data, you will find that the same data is displayed in both modes(Hotplug and Normal)

Do you confirm this ?


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello, here is the output:

PS C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> ./STM32_Programmer_CLI.exe -c port=SWD mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.13.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF6E065056705437210781
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.23V
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  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M0+
BL Version  : 0xB2
 
0x08080000 : 00 00 00 00 00 00 00 00
 
0x08080C00 : 00 00 00 00 00 00 00 00
 
PS C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> ./STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.13.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF6E065056705437210781
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.23V
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
 
0x08080000 : 00 00 00 00 00 00 00 00
 
0x08080C00 : 00 00 00 00 00 00 00 00

Would perhaps help not to carry multiple duplicate threads?

https://community.st.com/s/question/0D53W00002B9rrzSAB/how-to-write-bytes-to-flash-without-restart

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

Yes that is right! Feel free to close this thread. I do not see that I can do it

Hello @ADiet.1​ ,

The output you shared is similar to the previous one (first words of EEPROM1 and EEPROM2 are empty).

=> This doesn't show the inconsistent reads you are getting.

Please run the following CLI instructions with the flash erased and share the full log in an attached text file :

>STM32_Programmer_CLI -c port=SWD -blankcheck
>STM32_Programmer_CLI -c port=SWD -w32 0x08080000 0xAAAAAAAA
>STM32_Programmer_CLI -c port=SWD -w32 0x08080C00 0xBBBBBBBB
>STM32_Programmer_CLI -c port=SWD mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8
>STM32_Programmer_CLI -c port=SWD mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8

Thanks,

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I guess the inconsistency is another ticket.

Hi @ADiet.1​ ,

I mean the issue you talked about here on this post:

0693W00000aJTxxQAG.png 

Aziz


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Maybe what I mean is the following:

0693W00000aJTz0QAG.pngChecking the flag BFB2 on UI and command line gives inconsistent results! I have no idea to know which one is correct!