Skip to main content
DarkLight
Associate
November 22, 2020
Solved

No OptionByte setting from file

  • November 22, 2020
  • 2 replies
  • 1451 views

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?

This topic has been closed for replies.
Best answer by Houda GHABRI

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

2 replies

Houda GHABRI
Houda GHABRIBest answer
ST Employee
November 22, 2020

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

DarkLight
DarkLightAuthor
Associate
November 24, 2020

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
November 24, 2020

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

DarkLight
DarkLightAuthor
Associate
November 24, 2020

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! :ok_hand: