cancel
Showing results for 
Search instead for 
Did you mean: 

How to change option bytes in STM32CubeIDE?

GearHead
Associate II

I'm working with an STM32F04, and I'd like to change the option bytes so that my firmware can't be read back out after the device is programmed. I can tell from documentation I need to set the RDP byte to something besides 0xAA or 0xCC, but there isn't much about how to do this from the IDE.

Is there an option or a file I can edit in the STM32CubeIDE to modify the byte once my firmware is programmed?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The only way to do this in STM32CubeIDE is to add a separate section in the linker for your option bytes.

The easiest way to change them is probably in STM32CubeProgrammer or in your startup code. Just add a section that checks RDP and change it if necessary.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

The only way to do this in STM32CubeIDE is to add a separate section in the linker for your option bytes.

The easiest way to change them is probably in STM32CubeProgrammer or in your startup code. Just add a section that checks RDP and change it if necessary.

If you feel a post has answered your question, please click "Accept as Solution".

Thank you! I just downloaded CubeProgrammer and this is exactly what I was hoping for - automatic programming and option byte modification. Hopefully this helps the next person - it's easy to get lost with all of the different IDE/ DFuse/ etc. tools available