cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB capricious fuss. How to erase chip to factory settings

Ronil
Senior

Hello all) 

To work with BLE I need to upload 

 

 

stm32wb5x_BLE_Stack_full_fw.bin

 

 

with address 

 

 

0x080CE000

 

 

via STM32CubeProgrammer

It works as well, I did it many times, if check the box first boot for stack 

but I forgot (and not first time) to do that and now my BLE doesn't work on one of my devices

I made full chip erase, reuploaded stake, removed stack, and installed again dozen times via STM32CubeProgrammer, I did all can via  STM32CubeProgrammer (probably)

but it doesn't work anymore. 

Why STM32WB so capricious in this situation? 

Does it exist any opportunity to erase the chip to factory settings with the stack as well, let's say a more hard option than provided in  STM32CubeProgrammer ?

FUS.jpg

25 REPLIES 25

Yes, of course, I attached image here New Bitmap Image.jpg

Hello @Ronil 

Could you Perform a factory reset to restore the device to its default state. This can be done by writing the value 0x00008000 to the address 0x5800040C. Then, update your FUS and install the Stack.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello, thank you so much for your support. 

According to your advice - I used the next command 

STM32_Programmer_CLI.exe -c port=SWD -w32 0x5800040C 0x00008000

and it looks like that 

 

08bf8040-d86f-4e8c-8268-a610e0253820.jpeg

Actually, I am not sure that "restore the device to its default state" was successfully performed since, via "STM32CubeProgrammer," I still see that data was not erased from device memory, and Stack and Fuse are still the same.  Can you conform that it as ok? 

I uploaded again many times FUS and Stack but BLE is still not visible.

 

Also you can see details about the current status is here 

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=SWD -ob displ
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

ST-LINK SN  : 53FF6F064975484913150867
ST-LINK FW  : V2J37S7
Board       : --
Voltage     : 3.28V
SWD freq    : 4000 KHz
Connect mode: Normal
Reset mode  : Software reset
Device ID   : 0x495
Revision ID : Rev Y
Device name : STM32WB5x/35xx
Flash size  : 1 MBytes
Device type : MCU
Device CPU  : Cortex-M4
BL Version  : 0xD5
Debug in Low Power mode enabled


UPLOADING OPTION BYTES DATA ...

  Bank          : 0x00
  Address       : 0x58004020
  Size          : 96 Bytes

██████████████████████████████████████████████████ 100%

  Bank          : 0x01
  Address       : 0x58004080
  Size          : 8 Bytes

██████████████████████████████████████████████████ 100%


OPTION BYTES BANK: 0

   Read Out Protection:

     RDP          : 0xAA (Level 0, no protection)

   BOR Level:

     BOR_LEV      : 0x0 (BOR Level 0 reset level threshold is around 1.7 V)

   User Configuration:

     nBOOT0       : 0x1 (nBOOT0=1 Boot from main Flash)
     nBOOT1       : 0x1 (Boot from code area if BOOT0=0 otherwise system Flash)
     nSWBOOT0     : 0x0 (BOOT0 taken from the option bit nBOOT0)
     SRAM2RST     : 0x0 (SRAM2 erased when a system reset occurs)
     SRAM2PE      : 0x1 (SRAM2 parity check disable)
     nRST_STOP    : 0x1 (No reset generated when entering the Stop mode)
     nRST_STDBY   : 0x1 (No reset generated when entering the Standby mode)
     nRSTSHDW     : 0x1 (No reset generated when entering the Shutdown mode)
     WWDGSW       : 0x1 (Software window watchdog)
     IWDGSTDBY    : 0x1 (Independent watchdog counter running in Standby mode)
     IWDGSTOP     : 0x1 (Independent watchdog counter running in Stop mode)
     IWDGSW       : 0x1 (Software independent watchdog)
     IPCCDBA      : 0x0  (0x0)

   Security Configuration Option bytes - 1:

     ESE          : 0x1 (Security enabled)

   PCROP Protection:

     PCROP1A_STRT : 0x1FF  (0x80FF800)
     PCROP1A_END  : 0x0  (0x8000800)
     PCROP_RDP    : 0x0 (PCROP zone is kept when RDP is decreased)
     PCROP1B_STRT : 0x1FF  (0x80FF800)
     PCROP1B_END  : 0x0  (0x8000800)

   Write Protection:

     WRP1A_STRT   : 0xFF  (0x80FF000)
     WRP1A_END    : 0x0  (0x8000000)
     WRP1B_STRT   : 0xFF  (0x80FF000)
     WRP1B_END    : 0x0  (0x8000000)
OPTION BYTES BANK: 1

   Security Configuration Option bytes - 2:

     SFSA         : 0xCE  (0x80CE000)
     FSD          : 0x0 (System and Flash secure)
     DDS          : 0x1 (CPU2 debug access disabled)
     C2OPT        : 0x1 (SBRV will address Flash)
     NBRSD        : 0x0 (SRAM2b is secure)
     SNBRSA       : 0xF  (0x2003BC00)
     BRSD         : 0x0 (SRAM2a is secure)
     SBRSA        : 0xA  (0x20032800)
     SBRV         : 0x33800  (0x20000000)

 

 

 

 

Everything Should be fine. Could you give me a description of what you do for Stack and FUS upgrade (step by step if possible).

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Yes, of course,

two-way

first, via STM32CubeProgrammer connect

 

1.1. Connect with the board 

 upload stm32wb5x_FUS_fw.bin to 0x080EC000

and after

1.2. upload stm32wb5x_BLE_Stack_full_fw.bin to 0x080CE000

1.3. Start wireless stack

1.4. Upload Hex file 

1.5. Disconnect with STM32CubeProgrammer and Reset MCU

 

 

and via STM32_Programmer_CLI.exe did the same, without the result 

also I tried 

STM32_Programmer_CLI.exe -c port=SWD -w32 0x5800040C 0x00008000 

and full chip erase via  STM32CubeProgrammer

Start FUS STM32CubeProgrammer

remove stack and upload as first time via STM32CubeProgrammer

 

Options byte
{
"deviceId" : 1173,
"bitNameToValue" : {
"RDP" : 170,
"BOR_LEV" : 0,
"nBOOT0" : 1,
"nBOOT1" : 1,s
"nSWBOOT0" : 0,
"SRAM2RST" : 0,
"SRAM2PE" : 1,
"nRST_STOP" : 1,
"nRST_STDBY" : 1,
"nRSTSHDW" : 1,
"WWDGSW" : 1,
"IWDGSTDBY" : 1,
"IWDGSTOP" : 1,
"IWDGSW" : 1,
"IPCCDBA" : 0,
"ESE" : 1,
"PCROP1A_STRT" : 511,
"PCROP1A_END" : 0,
"PCROP_RDP" : 0,
"PCROP1B_STRT" : 511,
"PCROP1B_END" : 0,
"WRP1A_STRT" : 255,
"WRP1A_END" : 0,
"WRP1B_STRT" : 255,
"WRP1B_END" : 0,
"SFSA" : 206,
"FSD" : 0,
"DDS" : 1,
"C2OPT" : 1,
"NBRSD" : 0,
"SNBRSA" : 11,
"BRSD" : 0,
"SBRSA" : 18,
"SBRV" : 249856
}
}

Have you tried to upload one of our ST Example. It may be a problem on your firmware.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi, yes, I did it a few times, without a result. Actually the same problem I had and in STM32WB Nucleo board 

Could you please check what is the content of the address 0x5800040c.

PS: Are you using the Version 2.17.0 of the Cube Programmer. If no, please update it and repeat the same configuration for FUS and Stack.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.