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, STM32CubeProgrammer 2.17.0

 

via STM32_Programmer_CLI.exe -c port=SWD -r32 0x5800040C 1

0x5800040C : 00000000

Could you write 0x00008000 on this address.

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, I did , but when I read register it is again 0  
or I do something wrong ?

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin> STM32_Programmer_CLI.exe -c port=SWD -w32 0x5800040C 0x00008000
      -------------------------------------------------------------------
                       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

Write 32-bit data
w @0x5800040c:  0x00008000


Downloading...
██████████████████████████████████████████████████ 100%
32-bit data download complete

C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=SWD -r32 0x5800040C 1
      -------------------------------------------------------------------
                       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


Reading 32-bit memory content
  Size          : 4 Bytes
  Address:      : 0x5800040C

0x5800040C : 00000000

, o 

I can't see really any issue that may be a source for this problem.

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.

I spent a few days, but still didnt resore my BLE,  I found this link https://community.st.com/t5/stm32-mcus-wireless/how-can-i-reset-the-p-nucleo-wb55-to-original-demo-firmware/td-p/250183/page/2
where the author had a similar problem, to solve it looks like need to use a BOOT0 pin.
In my case, I used a custom design which BOOT0 doesn't use. I wanted to ask, how do you think BOOT0 is in necessary to use in this case?

If yes, can you order and the condition should be BOOT0   for the next steps? 

 

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

 

Ronil
Senior

Hi @STTwo-32  I added the settings for my BLE, Would it be helpful?

 

bin>STM32_Programmer_CLI -c port=SWD -ob displ
      -------------------------------------------------------------------
                       STM32CubeProgrammer v2.17.0
      -------------------------------------------------------------------

ST-LINK SN  : 6798040132124647524B4E00
ST-LINK FW  : V2J37S7
Board       : --
Voltage     : 3.15V
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     : 0x1 (SRAM2 is not 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)