cancel
Showing results for 
Search instead for 
Did you mean: 

Can't program the option bytes using CLI?

thansen
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello again @thansen ,
You forgot the -ob before SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Kouthair
ST Employee

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.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

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

Hello again @thansen ,
You forgot the -ob before SECWM1_STRT=0x0 SECWM1_END=0x0 SECWM2_STRT=0x1f SECWM2_END=0x0.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thank you very much for your quick response, now it works and I now also think I understand how the command is buildup.