Question
STM32WB15CCU6: Cannot restore corrupt option bytes
- 3 replies
- 3923 views
For a project for one of our customers, we use STM32WB15CCU6 microcontrollers on a custom board. The boards are returning from the field with several of the option bytes of the microcontroller set to a different value than they were programmed with. We would like help in restoring them.
We don't use the bluetooth functionality of the STM32WB15CCU6; we just use it as a general purpose microcontroller; we don't have the wireless stack on the microcontroller.
We connect to the STM32WB15CCU6 via an ST-LINK, over SWD. We read out the option bytes with 'STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD -ob displ'. On the broken board, there are three option bytes different (compared to the known-good board). The values on broken board are in red, the working board is in green.

We tried to correct these bytes, by issueing the 'STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD -ob SBRSA_A=0x00 C2OPT=1 SBRSA_B=0x2' command, but this does not appear to work, and outputs:
OPTION BYTE PROGRAMMING VERIFICATION:
Error: Expected value for Option Byte "c2opt": 0x1, found: 0x0
Error: Expected value for Option Byte "sbrsa_a": 0x0, found: 0x1F
Error: Expected value for Option Byte "sbrsa_b": 0x2, found: 0x0
Error: Option Byte Programming failed Or modified by application after OB_LAUNCH
Factory resetting (by issueing 'STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI -c port=SWD reset=HWrst -w32 0x5800040c 0x00008000') does not seem to help. After the supposed factory reset and power-cycling the board, if we read out that address, it still contains 0x00008000. If we read the FUS version in STM32CubeProgrammer, it returns all zeroes for the version:

If we read out the memory where the FUS should be, we get this (see image in attachment)
At this point, we're not sure how to proceed; I think we've exhausted all options on https://wiki.st.com/stm32mcu/wiki/Connectivity:STM32WB_FUS#FAQ. We would like help to restore the option bytes to their original values.
