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?

1 ACCEPTED SOLUTION

Accepted Solutions

This

0693W00000aIfe2QAC.png 

should result in debugger connecting without reset. There should be a counterpart to this in the CLI too.

JW

View solution in original post

23 REPLIES 23

This

0693W00000aIfe2QAC.png 

should result in debugger connecting without reset. There should be a counterpart to this in the CLI too.

JW

ADiet.1
Associate III

I tried that, but when I use the mode HOTPLUG I get incorrect results! The application returns bytes that are incorrect!!

ADiet.1
Associate III

I asked for 8 bytes at two different addresses and when using HOTPLUG I got the results swapped (checked with GUI application). now it seems to be working. I have the feeling I cannot rely on these tools. What can I do?

If you can reproduce inconsistent or wrong reads, please post a bug report here.

> I asked for 8 bytes at two different addresses and when using HOTPLUG I got the results swapped (checked with GUI application).

Show.

Also, try to read out a known piece of ROM memory, e.g. the device ID or Unique ID, and compare to expected values, and/or readout under reset.

JW

ADiet.1
Associate III

I also noticed something else: I just did this 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

to write some bytes, and this command did NOT trigger a reset. I thought with "mode=Normal" it is resetting?

I just connected with the GUI version and disconnected, and that did trigger a reset. Maybe the version (2.12.0) I am using on the CLI has bugs?

ADiet.1
Associate III

Example of incorrect results: Is that flag AE now on 0x08080000 or on 0x08080C00? Which output is the correct one?

PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>  .\STM32_Programmer_CLI.exe -c port=SWD mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.12.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF6E065056705437210781
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.24V
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 AE 00 00 00
 
0x08080C00 : 00 00 00 00 00 00 00 00
 
PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>  .\STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.12.0
      -------------------------------------------------------------------
 
ST-LINK SN  : 53FF6E065056705437210781
ST-LINK FW  : V2J29S7
Board       : --
Voltage     : 3.24V
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 AE 00 00 00

PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> .\STM32_Programmer_CLI.exe -c port=SWD mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.12.0

   -------------------------------------------------------------------

ST-LINK SN : 53FF6E065056705437210781

ST-LINK FW : V2J29S7

Board    : --

Voltage   : 3.24V

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 AE 00 00 00

0x08080C00 : 00 00 00 00 00 00 00 00

PS C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> .\STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8

   -------------------------------------------------------------------

            STM32CubeProgrammer v2.12.0

   -------------------------------------------------------------------

ST-LINK SN : 53FF6E065056705437210781

ST-LINK FW : V2J29S7

Board    : --

Voltage   : 3.24V

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 AE 00 00 00

ADiet.1
Associate III

Just opened a bug report. Something is definitively not correct with the STM32CubeProgrammer application!

Hello @ADiet.1​,

I can't reproduce the issue you're facing for now. However, could you please share the trace for the following CLI instructions ? Erasing the flash might change things depending on the application you're running. If this is the case, I will provide further details on what is happening.

>STM32_Programmer_CLI.exe -c port=SWD -e all
>STM32_Programmer_CLI.exe -c port=SWD mode=NORMAL -r8 0x08080000 8 -r8 0x08080C00 8
>STM32_Programmer_CLI.exe -c port=SWD mode=HOTPLUG -r8 0x08080000 8 -r8 0x08080C00 8

Your feedback will be very helpful.

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.