cancel
Showing results for 
Search instead for 
Did you mean: 

Define the Option Bytes in the code

DCall.2
Associate

Hello, I am new user and I am using SMT32G031K8.

I am finalizing the development of my code and I have one last problem with the "OPTION BYTE"

Topic: I need to change the IWDG_STOP bit of the USER configuration OptionByte

Test carried out: I have successfully used the STM32Programmer tool

Problem: I have to produce a binary file to be sent to production that has already set the option bytes according to my needs

Test: I tried to redefine them by editing the linker file with two different IDE

- IAR using #pragma directives directly in my code but with no correct results

- CubeIDE using attribute directives always unsuccessful

Is it possible to have an example to include the setting of the USER option Byte directly in the source code or in the linker file? (possibly for IAR environment)

NOTE:

User option Byte address: 0x1FFF7800

Default Value: 0xFFFFFEAA

myValue: 0xFFFDFEAA

Thanks for everything

2 REPLIES 2

STM32Cube_FW_G0_V1.4.0\Projects\STM32G0C1E-EV\Applications\OpenBootloader\OpenBootloader\Target\flash_interface.c

STM32Cube_FW_G0_V1.4.0\Projects\STM32G0C1E-EV\Applications\OpenBootloader\OpenBootloader\Target\optionbytes_interface.c

STM32Cube_FW_G0_V1.4.0\Projects\STM32G0316-DISCO\Demonstrations\Src\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..