Showing results for 
Search instead for 
Did you mean: 

Trouble with RDP regression using CLI on windows


Hello, I am trying to regress from RDP2 on my STM32U585AII6. I have no problem doing this from the STM32CubeProgrammer GUI, but when I try using the STM32_Programmer_CLI software I get:

.\STM32_Programmer_CLI.exe -c port=SWD mode=UR -unlockRDP2 0xHighKey 0xLowKey
STM32CubeProgrammer v2.13.0

ST-LINK SN : 0042001A4D46500F20383832
Voltage : 3.26V
Error: Cannot connect to access port 0!
If you are trying to connect to a device with TrustZone enabled please try to connect with HotPlug mode.
If you are trying to connect to H5 device and your target is already locked with password or certificate, please open your device using Debug Authentication.


I get the same result when I try with mode=hotplug. After executing these lines the device comes up as normal, so the flash is not getting touched. When I go through the GUI, things work fine so I know the keys are correct and the debugger works. I've tried swapping the keys and there is no change.

I have noticed the v2.15.0 has a bug and does not allow RDP regression.

Can this work from the command line?

ST Employee

Hello @pscheidler,

Thanks for posting and sorry for the late reply,

Regarding RDP regression with password via GUI, it is a known limitation since v2.14 (for further details please refer to CubeProgrammer release notes), we are aware of the issue and working on it (internal ticket number : 126305).

However, you should be able to unlock RDP1/2 via CLI in all CubeProgrammer versions. Please verify IWDG and WWDG option bytes are checked (Reset generated when those OBs are unchecked can interfere with the unlock sequence).


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.