2020-11-09 12:52 AM
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
2020-11-09 01:59 AM
Hello @Chan.Calvin
Could you please share your sample.hex file ?
Thanks
Khouloud
2020-11-10 06:02 PM
I dont think this is related to the sample.hex file. The reason is that, I tried the following command:
>STM32_Programmer_CLI.exe -c port=COM4 -rdu -ob displ
just to remove read protection, and display the option bytes, and get the same output:
*********************************
-------------------------------------------------------------------
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.
***************************
Rgds
Calvin
2020-11-10 06:31 PM
By the way, is it because the timeout is too short? Is there a parameter to modify the default timeout to be longer to try out?
Notes: The test I carried out is on the MCU that is already with readout protection removed (RDP = 0xAA)
2020-11-16 06:13 PM
@Khouloud ZEMMELI Is there any further comment about this timeout issue?
Calvin
2023-12-05 06:33 AM
I also have this problem and altering the command line does not make the problem go away. I have tried to add the -rdu option as well and then I get a message telling me that the read protection was disabled successfully - but it isn't. MCU is STM32F072RB
Without -rdu:
STM32_Programmer_CLI.exe -c port=usb1 -e all -w myimage.hex -v -ob nBOOT_SEL=0 -ob displ
-------------------------------------------------------------------
STM32CubeProgrammer v2.15.0
-------------------------------------------------------------------
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : FFFFFFFEFFFF
DFU protocol: 1.1
Board : --
Device ID : unknown
Warning: Device is under Read Out Protection
Error: RDP level is set to 1, try using Read UnProtect (-rdu) command in order to remove the Read Out Protection.
With -rdu:
-------------------------------------------------------------------
STM32CubeProgrammer v2.15.0
-------------------------------------------------------------------
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : FFFFFFFEFFFF
DFU protocol: 1.1
Board : --
Device ID : unknown
Warning: Device is under Read Out Protection
Disabling memory Read Protection...
Memory Read Protection disabled successfully
Error: RDP level is set to 1, try using Read UnProtect (-rdu) command in order to remove the Read Out Protection.
2024-03-07 11:27 AM
Hello
I'm also facing this problem. The "rdp=0xAA" in STM32F0 by command line isn't working and when I change it to "-rdu", there's an "ack timeout" error. But as the flash is empty, the command worked correctly. I'm using CubeProgrammer v2.15.0 w64.