WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Discussion options

You must be logged in to vote

Hi @MadZoids,

Does option bytes always reset to factory configuration on new compile on generic board variants?

No, Option bytes remains after reset or power OFF/ON. And it is not changed on compilation nor during download of binary in flash.

Can we change the option bytes from sketch level?

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MadZoids
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants