Skip to main content
Ddu P
Associate III
November 5, 2020
Question

Disable Readout Protection from STM32CubeIDE Before Programming

I know that STM32CubeIDE calls STM32_Programmer_CLI.exe in order to program the chip, and I know that I can get STM32_Programmer_CLI.exe to disable readout protection on the chip by passing it a --readunprotect parameter, but how/where in STM32CubeIDE can I set this up?

My code enables read protection on the chip, and so this needs to be disabled before reprogramming, but I would obviously prefer to not have to do this manually every time before reprogramming.

This topic has been closed for replies.

3 replies

TDK
November 5, 2020

You could add disabling readout protection as a post-build step, but it would execute every time you build the project. You could also add it as an external command (Run -> External Tools). Might be another way but I don't know of it.

"If you feel a post has answered your question, please click ""Accept as Solution""."
alister
Senior III
November 5, 2020

Use two build configurations, e.g. Debug and Release, define a symbol e.g. DEBUG in the Debug configuration, use it to not initialise RDP if DEBUG's defined, and if there's secure boot too, use a different key if DEBUG's defined.

Andrei Chichak
Lead
November 9, 2020

@Ddu P​ has a good point. With OpenOCD, in Eclipse's debugger startup commands you could issue the command 'monitor stm32f2x unlock 0' and this would unlock and erase a processor that had been protected.

Now that STM32CubeIDE has come along, how do we do an equivalent thing with the new server setup? I've tried a few things but have not been able to get CubeIDE to send the --readunprotect parameter to STM32_Programmer_CLI.exe.