2020-11-05 06:32 AM
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.
2020-11-05 10:28 AM
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.
2020-11-05 11:18 AM
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.
2020-11-09 10:37 AM
@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.