cancel
Showing results for 
Search instead for 
Did you mean: 

No OptionByte setting from file

DarkLight
Associate II

I am trying to migrate from UM0462 Flash Loader Demonstrator to the STM32CubeProgrammer (upon a recommendation from STM, as the former becomes obsolete). Yet I seem to be missing the option of loading OptionByte file.0693W000005CCnsQAG.jpgThe documentation for cube refers to option byte, but not as a file:

Option bytes command

-ob, --optionbytes

Description: This command allows the user to manipulate the device option bytes by displaying or modifying them.

Syntax: -ob [displ] / -ob [OptByte=<value>]

[displ]: Allows the user to display the whole set of option bytes.

[OptByte=<value>]: Allows the user to program the given option byte.

Example

./STM32_Programmer.sh –c port=swd –ob rdp=0x0 –ob displ

How does one load an OptionByte.hex file, besides the .bin file?

1 ACCEPTED SOLUTION

Accepted Solutions
Houda GHABRI
ST Employee

Hi @שי קיסרי קיסרי​ ,

With STM32CubeProgrammer you can use -d command to download a hex file to Option bytes, Flash , external Falsh ,OTP, RAM.

Your hex file can combine different destination : Option Byte + Flash, no need to a seperate file.

The Command should be : ./STM32_Programmer.sh –c port=swd  -d OptionByte.hex

regards,

Houda

View solution in original post

4 REPLIES 4
Houda GHABRI
ST Employee

Hi @שי קיסרי קיסרי​ ,

With STM32CubeProgrammer you can use -d command to download a hex file to Option bytes, Flash , external Falsh ,OTP, RAM.

Your hex file can combine different destination : Option Byte + Flash, no need to a seperate file.

The Command should be : ./STM32_Programmer.sh –c port=swd  -d OptionByte.hex

regards,

Houda

Dear Houda,

Thank you for the reply! this is indeed what I wanted. May I bother you further?

How does one state the OptionByte file from the GUI? The "Erasing & Programming" tab features an option bytes command only at the Automatic Mode section.

If I put in the OptionByte.Hex path in the Download section - will the software automatically detect this as an optionByte file?

Houda GHABRI
ST Employee

Hi @שי קיסרי קיסרי​ ,

Yes in "Erasing & Programming" tab just select your hex file and STM32CubePrgrammer will automatically detect it as Option Bytes File based on the destination address present in the Hex file.

regards,

Houda

Understood. To recap:

1) In command line, I can add the OptByte file along with the program file, with the option –c port=swd -d OptionByte.hex

2) In GUI, I need to do it in two different steps, first load the OptBte file, then the program file.

Thank you! 👌