2020-06-07 04:00 AM
HI all,
I tried change option bytes for STM32WB55 in code, and probably something went wrong when I did this. After programming MCU I found that my flash was probably be blocked:
How can I unblock FLASH? I tried change security config options in STM32CubeProgrammer, used CLI, used DFU mode but It didn not help. In all the time I have error:
STM32_Programmer_CLI -c port=swd -ob SFSA=0xcb
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 066FFF393738425043065240
ST-LINK FW : V2J35M26
Voltage : 3.27V
SWD freq : 4000 KHz
Connect mode: Normal
Reset mode : Software reset
Device ID : 0x495
Device name : STM32WB55xx
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M0+/M4
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x58004020
Size : 104 Bytes
██████████████████████████████████████████████████ 100%
PROGRAMMING OPTION BYTES AREA ...
Bank : 0x00
Address : 0x58004020
Size : 104 Bytes
██████████████████████████████████████████████████ 100%
Reconnecting...
Reconnected !
UPLOADING OPTION BYTES DATA ...
Bank : 0x00
Address : 0x58004020
Size : 104 Bytes
██████████████████████████████████████████████████ 100%
OPTION BYTE PROGRAMMING VERIFICATION:
Error: Expected value for Option Byte "sfsa": 0xCB, found: 0x0
Error: Option Byte Programming failed
Greetings
Solved! Go to Solution.
2022-06-08 08:48 AM
Can you still access the option byte ad dtry to set the watchdog option back to its original value.
Then try
The SFSA value should revert to 0xF4 with all the user memory erased of any previous FW.
2020-06-07 01:42 PM
SFSA cannot be modified by the application being a code running on the M4 core or a command sent from the CubeProgrammer tool.
This is a secure option byte. Any trial to modify it triggers a safeguard action blocking all accesses to the flash memory and protecting the complete flash area by setting the SFSA option byte to 0.
The only way to recover (if and only if the FUS version the chip is V1.1.0) is to write the value 0x00008000 (instead of 0) at the address 0x5800040c. This will reset the device to its manufactory state: A clear flash memory.
2020-06-07 01:43 PM
Trying to modify any of the secure option byte will end with the same result: a completely protected flash memory.
2020-06-07 01:55 PM
Thanks for answer
I treied change this bit after flash was blocked, before I didnot change any security/protect bit.
My MCU has FUS version the chip is V1.2.0 - how clearig flash memory in this wersion ?
STM32_Programmer_CLI -c port=swd -w32 0x5800040c 0x00008000
2020-06-08 12:44 AM
Unfortunately, this does not work with V1.0.2. V1.1.0 was released to support this roll back to the manufactory state.
I am afraid there is no way to unblock your board.
2020-06-08 12:56 AM
"Unfortunately, this does not work with V1.0.2."
I have FUS in V1.2.0, in this versiuon it is support ?
2020-06-08 03:08 AM
FUS V1.2.0 does not exist. The most recent FUS version is the V1.1.0.
2020-06-08 03:24 AM
Oh my mistake. I have folder STM32Cube_FW_WB_V1.2.0, You are right there is version v1.0.2 :(
2020-06-08 03:43 AM
I am afraid there is no way to unblock your board. You may try to load FUS V1.1.0 but it is not expected to be possible.
2020-06-08 03:45 AM
In code I tried change OPTR register (change watchdog function) and after that it happened :\ I checked all bits in this register and I don't know which bit can block flash