2026-05-11 7:35 AM
Trying to program the option bytes I get the error message shown below. Can someone tell me what is wrong? I have tried with and without the displ and I have also tried with only one option byte at the time.
C:\Temp\BMSM-18>"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD -ob TZEN=B4 SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0 displ
-------------------------------------------------------------------
STM32CubeProgrammer v2.22.0
-------------------------------------------------------------------
ST-LINK SN : 003F00383234511537333934
ST-LINK FW : V3J15M7
Board : STLINK-V3MINIE
Voltage : 3.29V
SWD freq : 8000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x478
Revision ID : --
Device name : STM32H533/523
NVM size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M33
BL Version : 0xE2
SFSP Version: v1.2.0
Debug in Low Power mode enabled
Error: Wrong command -ob tzen=b4 secwm1_strt=0x0 secwm1_end=0x0 secwm2_strt=0x1f secwm2_end=0x0 displ: Unknown command or command missed some parameters, please refer to the help to see the supported commands.
Solved! Go to Solution.
2026-05-12 2:14 AM - edited 2026-05-12 2:14 AM
Hello again @thansen ,
You forgot the -ob before SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0.
2026-05-11 8:02 AM - edited 2026-05-11 8:04 AM
Hello @thansen ,
Can you try this command instead ?
> STM32_Programmer_CLI.exe -c port=SWD -ob TZEN=0xB4 -ob SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0 -ob displ
I have put the changes made to your command in bold.
2026-05-11 11:43 PM
Hi Kouthair,
now the programming seems to run but then the verification afterwards fails.
C:\Users\tkofo>"C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe" -c port=SWD -ob TZEN=0xB4 SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0 -ob displ
-------------------------------------------------------------------
STM32CubeProgrammer v2.22.0
-------------------------------------------------------------------
ST-LINK SN : 003F00383234511537333934
ST-LINK FW : V3J15M7
Board : STLINK-V3MINIE
Voltage : 3.29V
SWD freq : 8000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x478
Revision ID : --
Device name : STM32H533/523
NVM size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M33
BL Version : 0xE2
SFSP Version: v1.2.0
Debug in Low Power mode enabled
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x40022050
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x01
Address : 0x40022070
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x02
Address : 0x40022080
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x03
Address : 0x400220e0
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x04
Address : 0x400221e0
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x05
Address : 0x40022090
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x06
Address : 0x400220f0
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x07
Address : 0x400221f0
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x08
Address : 0x400220f8
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x09
Address : 0x400221f8
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
PROGRAMMING OPTION BYTES AREA ...
Warning: Option Byte: secwm1_strt, value: 0x0, was not modified.
Bank : 0x04
Address : 0x400221e0
Size : 16 Bytes
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Bank : 0x03
Address : 0x400220e0
Size : 16 Bytes
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Bank : 0x01
Address : 0x40022070
Size : 16 Bytes
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
Reconnecting...
Reconnected !
Reconnecting...
Reconnected !
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x50022050
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x01
Address : 0x50022070
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x02
Address : 0x50022080
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x03
Address : 0x500220e0
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x04
Address : 0x500221e0
Size : 16 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x05
Address : 0x50022090
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x06
Address : 0x500220f0
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x07
Address : 0x500221f0
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x08
Address : 0x500220f8
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
Bank : 0x09
Address : 0x500221f8
Size : 8 Bytes
██████████████████████████████████████████████████ 100%
OPTION BYTE PROGRAMMING VERIFICATION:
Error: Expected value for Option Byte "secwm1_end": 0x0, found: 0x1F
Error: Expected value for Option Byte "secwm2_end": 0x0, found: 0x1F
Error: Expected value for Option Byte "secwm2_strt": 0x1F, found: 0x0
Error: Option Byte Programming failed Or modified by application after OB_LAUNCH
Time elapsed during option Bytes configuration: 00:00:02.609
2026-05-12 2:14 AM - edited 2026-05-12 2:14 AM
Hello again @thansen ,
You forgot the -ob before SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0.
2026-05-12 2:26 AM
Thank you very much for your quick response, now it works and I now also think I understand how the command is buildup.