-
Does option bytes always reset to factory configuration on new compile on generic board variants? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @MadZoids,
No, Option bytes remains after reset or power OFF/ON. And it is not changed on compilation nor during download of binary in flash.
There is no dedicated API to do so in Arduino. |
Beta Was this translation helpful? Give feedback.
Hi @MadZoids,
No, Option bytes remains after reset or power OFF/ON. And it is not changed on compilation nor during download of binary in flash.
There is no dedicated API to do so in Arduino.
Nevertheless you can still make use of STM32 HAL/LL or even direct Register access (all are accessible from Arduino sketch level)
Like:
HAL_FLASH_OB_Unlock()
HAL_FLASHEx_OBProgram()
See for example https://github.com/STMicroelectronics/STM32CubeL4/tree/master/Projects/NUCLEO-L412KB/Examples/FLASH/FLASH_WriteProtection