When we enter commands , we observe Error: ST-LINK error (DEV_TARGET_CMD_ERR) for the first time and when we enter the same command again (second try) it is executed.
We are facing this error when entering every commands. Second attempt of the command is passed while in first attempt we get ST Link error.
Please find the commands executed and error faced:
C:\Users\irgpsj>"C:/Program Files (x86)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD --erase all
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 34FF6D064D4E353842310643
ST-LINK FW : V2J31S7
Voltage : 3.20V
Error: ST-LINK error (DEV_TARGET_CMD_ERR)
C:\Users\irgpsj>"C:/Program Files (x86)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD --erase all
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 34FF6D064D4E353842310643
ST-LINK FW : V2J31S7
Voltage : 3.20V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x450
Device name : STM32H7xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M7
Mass erase ...
Mass erase successfully achieved
C:\Users\irgpsj>"C:/Program Files (x86)/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI" -c port=SWD --erase all
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 34FF6D064D4E353842310643
ST-LINK FW : V2J31S7
Voltage : 3.20V
Error: ST-LINK error (DEV_TARGET_CMD_ERR)
