cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Readout Protection from STM32CubeIDE Before Programming

Ddu P
Associate III

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.

3 REPLIES 3
TDK
Guru

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
Lead

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.

@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.