stm32cubeprog command line (STM32_Programmer_CLI.exe) question
Currently, I am trying out STM32_Programmer_CLI.exe (from STM32CubeProg version 2.5).
I am setting up a batch file to program a STM32G030 device via the serial bootloader.
With nB00T_SEL option flag cleared already, the following command is executed:
STM32_Programmer_CLI.exe -c port=COM4 -rdu -e all -w sample.hex -v -ob nBOOT_SEL=0 -ob displ
The following message is displayed:
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0
-------------------------------------------------------------------
Serial Port COM4 is successfully opened.
Port configuration: parity = even, baudrate = 115200, data-bit = 8,
stop-bit = 1.0, flow-control = off
Timeout error occured while waiting for acknowledgement.
Activating device: OK
Chip ID: 0x466
BootLoader protocol version: 3.1
Disabling memory read protection...
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Error: Unable to disable memory read protection
Timeout error occured while waiting for acknowledgement.
Error: GETID command not acknowledged!
Reemission of GetID command
Timeout error occured while waiting for acknowledgement.
Error: GETID command not acknowledged!
Reemission of GetID command
Timeout error occured while waiting for acknowledgement.
Error: GETID command not acknowledged!
Disabling memory Read Protection...
Timeout error occured while waiting for acknowledgement.
Timeout error occured while waiting for acknowledgement.
Error: Disabling memory Read Protection failed
Error: RDP level is set to 1 (0xBB), try using Read UnProtect (-rdu) command in order to remove the Read Out Protection.
Error: RDP level is set to 1 (0xBB), try using Read UnProtect (-rdu) command in order to remove the Read Out Protection.
Error: RDP level is set to 1 (0xBB), try using Read UnProtect (-rdu) command in order to remove the Read Out Protection.
---------------------------------
But by using a modified command line:
STM32_Programmer_CLI.exe -c port=COM4 -e all -w sample.hex -v -ob nBOOT_SEL=0 -ob displ
i.e. removing -rdu, and adding -e all, the command executed successfully, and new program is programmed in.
My intention is to program the chip by first to remove the read protection (ir-respect to whether the chip is read protected or not), and then program the chip, and then set read protection on again.
Any one has some suggestion as to how this can be achieved?
Rgds
Calvin
