2025-09-12 7:44 AM
I'm trying to develop a script to flash a secure firmware and set the option bytes on STM32H755. (more on that here https://community.st.com/t5/stm32-mcus-security/flashing-sbsfu-combined-binary-to-stm32h755-with-stm32/m-p/836377#M8786)
My specific question here is about the -ob option in the cube programmer CLI.
I'm keen to understand the difference between doing
set cube_programmer_cli="C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe"
%cube_programmer_cli% -c port=SWD mode=UR ^
-w %fw_bin% %fw_base% ^
-ob nWRP0=0 ^
-ob SWAP_BANK=0x0 ^
and
set cube_programmer_cli="C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe"
%cube_programmer_cli% -c port=SWD mode=UR ^
-w %fw_bin% %fw_base% ^
-ob nWRP0=0 SWAP_BANK=0x0
Do the two examples produce different operations and if so how?
2025-09-12 7:50 AM
Both syntaxes work, but there’s a small difference:
Writing -ob multiple times runs separate option-byte write operations, one after another.
Writing them all in a single -ob applies the changes together in one operation.
In most cases the end result is the same, but grouping them in one -ob is cleaner and avoids any chance of temporary invalid states between writes.