Skip to main content
OHaza.1
Associate III
February 16, 2022
Question

Override option bytes in firmware to prevent being locked out

  • February 16, 2022
  • 1 reply
  • 1161 views

Hi, we are using an STM32G05 series processor (STM32G051K6T6).

The default setting in the Cube Programmer software sets the option byte nBOOT_SEL to high. This effectively disables the BOOT0 pin and prevents reprogramming if the option byte was not cleared before writing.

Is it possible to overwrite this in the firmware, I presume in the linker, so that even if the option byte is written as high we will not be locked out from entering programming mode.

Thanks in advance

This topic has been closed for replies.

1 reply

TDK
Super User
February 16, 2022

You can change option bytes within firmware or within STM32CubeProgrammer, assuming you can connect to the chip. You can connect over SWD as long as you have not overridden the functions of the SWDIO and SWCLK pins.

STM32CubeProgrammer shouldn't change any option bytes unless you tell it to. They are persistent.

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