Updating Network Stack through SWD on STM32WB55 Leads to Errors
I attempted to update the network stack through SWD on a few STM32WB55 nucleo boards, dongles, and custom PCBs. The results were similar in all cases. When attempting to query the processor to see if the FUS is out-of-date (it should be since these were old boards), the return was:
C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=swd mode=UR -r32 0x20030030 1
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 55FF6D067880565343501667
ST-LINK FW : V2J36S7
Voltage : 3.22V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x495
Device name : STM32WB55xx
Flash size : 1 MBytes
Device type : MCU
Device CPU : Cortex-M0+/M4
Reading 32-bit memory content
Size : 4 Bytes
Address: : 0x20030030
0x20030030 : 00000000For one nucleo board, I attempted to update the FUS anyways and was thrown the following:
C:\Program Files (x86)\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin>STM32_Programmer_CLI.exe -c port=swd mode=UR -ob nSWboot0=0 nboot1=1 nboot0=1 -fwupgrade C:\Users\patrick\STM32Cube\Repository\STM32Cube_FW_WB_V1.5.0\Projects\STM32WB_Copro_Wireless_Binaries\STM32WB5x\stm32wb5x_FUS_fw_1_0_2.bin 0x080EC000 firstinstall=1
-------------------------------------------------------------------
STM32CubeProgrammer v2.4.0
-------------------------------------------------------------------
ST-LINK SN : 54FF70067880565344321167
ST-LINK FW : V2J36S7
Voltage : 3.21V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware 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 ...
Warning: Option Byte: nboot0, value: 0x1, was not modified.
Warning: Option Byte: nboot1, value: 0x1, was not modified.
Warning: Option Byte: nswboot0, value: 0x0, was not modified.
Warning: Option Bytes are unchanged, Data won't be downloaded
Download firmware image at address 0x80ec000 ...
Memory Programming ...
Opening and parsing file: stm32wb5x_FUS_fw_1_0_2.bin
File : stm32wb5x_FUS_fw_1_0_2.bin
Size : 24492 Bytes
Address : 0x080EC000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [236 241]
Download in Progress:
██████████████████████████████████████████████████ 100%
File download complete
Time elapsed during download operation: 00:00:00.839
...
...
this repeats a few times
...
...
Firmware Upgrade process started ...
Application is running
Reconnecting...
Reconnected !
Error: -- Reserved --
Error: fwupgrade Command Failure!
Download firmware image at address 0x80ec000 ...
Memory Programming ...
Opening and parsing file: stm32wb5x_FUS_fw_1_0_2.bin
File : stm32wb5x_FUS_fw_1_0_2.bin
Size : 24492 Bytes
Address : 0x080EC000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [236 241]
Download in Progress:
██████████████████████████████████████████████████ 100%
Error: failed to download Segment[0]
Error: failed to download the File
Error: Failed to download image!Edit:
Found the latest v1.6 fw version so I downloaded that and used SWD through the STM32CubeProgrammer GUI. I was able to delete the firmware successfully but kept getting an "Error: -- Reserved --" when trying to upgrade the FUS.
00:12:05 : Reconnecting...
00:12:05 : Reconnected !
00:12:05 : Error: -- Reserved --
00:12:05 : Old Firmware delete ...
00:12:05 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
00:12:05 : Warning: Option Byte: nboot0, value: 0x1, was not modified.
00:12:05 : Warning: Option Byte: nboot1, value: 0x1, was not modified.
00:12:05 : Warning: Option Bytes are unchanged, Data won't be downloaded
00:12:05 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
00:12:05 : Memory Programming ...
00:12:05 : Opening and parsing file: 0x495_FUS_Operator.bin
00:12:05 : File : 0x495_FUS_Operator.bin
00:12:05 : Size : 11584 Bytes
00:12:05 : Address : 0x08000000
00:12:05 : Erasing memory corresponding to segment 0:
00:12:05 : Erasing internal memory sectors [0 2]
00:12:05 : failed to erase memory
00:12:05 : failed to erase memory
00:12:05 : Failed to download FUS operator!
00:12:05 : Retry -- 0
00:12:05 : Old Firmware delete ...
00:12:05 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
00:12:05 : Warning: Option Byte: nboot0, value: 0x1, was not modified.
00:12:05 : Warning: Option Byte: nboot1, value: 0x1, was not modified.
00:12:05 : Warning: Option Bytes are unchanged, Data won't be downloaded
00:12:05 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
00:12:05 : Memory Programming ...
00:12:05 : Opening and parsing file: 0x495_FUS_Operator.bin
00:12:05 : File : 0x495_FUS_Operator.bin
00:12:05 : Size : 11584 Bytes
00:12:05 : Address : 0x08000000
00:12:05 : Erasing memory corresponding to segment 0:
00:12:06 : Erasing internal memory sectors [0 2]
00:12:06 : Download in Progress:
00:12:06 : File download complete
00:12:06 : Time elapsed during download operation: 00:00:00.521
00:12:06 : Application is running
00:12:14 : Reconnecting...
00:12:14 : Reconnected !
00:12:15 : Firmware delete Success
00:12:15 : Download Stack/FUS image at address 0x80ec000 ...
00:12:15 : Memory Programming ...
00:12:15 : Opening and parsing file: stm32wb5x_FUS_fw_1_0_2.bin
00:12:15 : File : stm32wb5x_FUS_fw_1_0_2.bin
00:12:15 : Size : 24492 Bytes
00:12:15 : Address : 0x080EC000
00:12:15 : Erasing memory corresponding to segment 0:
00:12:15 : Erasing internal memory sectors [236 241]
00:12:15 : Download in Progress:
00:12:16 : File download complete
00:12:16 : Time elapsed during download operation: 00:00:00.809
00:12:16 : Firmware Upgrade process started ...
00:12:16 : Application is running
00:12:26 : Reconnecting...
00:12:26 : Reconnected !
00:12:26 : Error: -- Reserved --
00:12:26 : Old Firmware delete ...
00:12:26 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
00:12:26 : Warning: Option Byte: nboot0, value: 0x1, was not modified.
00:12:26 : Warning: Option Byte: nboot1, value: 0x1, was not modified.
00:12:26 : Warning: Option Bytes are unchanged, Data won't be downloaded
00:12:26 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
00:12:26 : Memory Programming ...
00:12:26 : Opening and parsing file: 0x495_FUS_Operator.bin
00:12:26 : File : 0x495_FUS_Operator.bin
00:12:26 : Size : 11584 Bytes
00:12:26 : Address : 0x08000000
00:12:26 : Erasing memory corresponding to segment 0:
00:12:26 : Erasing internal memory sectors [0 2]
00:12:26 : failed to erase memory
00:12:26 : failed to erase memory
00:12:26 : Failed to download FUS operator!
00:12:26 : Retry -- 1
00:12:26 : Old Firmware delete ...
00:12:26 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
00:12:26 : Warning: Option Byte: nboot0, value: 0x1, was not modified.
00:12:26 : Warning: Option Byte: nboot1, value: 0x1, was not modified.
00:12:26 : Warning: Option Bytes are unchanged, Data won't be downloaded
00:12:26 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
00:12:26 : Memory Programming ...
00:12:26 : Opening and parsing file: 0x495_FUS_Operator.bin
00:12:26 : File : 0x495_FUS_Operator.bin
00:12:26 : Size : 11584 Bytes
00:12:26 : Address : 0x08000000
00:12:26 : Erasing memory corresponding to segment 0:
00:12:26 : Erasing internal memory sectors [0 2]
00:12:26 : Download in Progress:
00:12:27 : File download complete
00:12:27 : Time elapsed during download operation: 00:00:00.503
00:12:27 : Application is running
00:12:35 : Reconnecting...
00:12:35 : Reconnected !
00:12:36 : Firmware delete Success
00:12:36 : Download Stack/FUS image at address 0x80ec000 ...
00:12:36 : Memory Programming ...
00:12:36 : Opening and parsing file: stm32wb5x_FUS_fw_1_0_2.bin
00:12:36 : File : stm32wb5x_FUS_fw_1_0_2.bin
00:12:36 : Size : 24492 Bytes
00:12:36 : Address : 0x080EC000
00:12:36 : Erasing memory corresponding to segment 0:
00:12:36 : Erasing internal memory sectors [236 241]
00:12:36 : Download in Progress:
00:12:37 : File download complete
00:12:37 : Time elapsed during download operation: 00:00:00.807
00:12:37 : Firmware Upgrade process started ...
00:12:37 : Application is running
00:12:47 : Reconnecting...
00:12:47 : Reconnected !
00:12:47 : Error: -- Reserved --
00:12:47 : Old Firmware delete ...
00:12:47 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.
00:12:47 : Warning: Option Byte: nboot0, value: 0x1, was not modified.
00:12:47 : Warning: Option Byte: nboot1, value: 0x1, was not modified.
00:12:47 : Warning: Option Bytes are unchanged, Data won't be downloaded
00:12:47 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1
00:12:47 : Memory Programming ...
00:12:47 : Opening and parsing file: 0x495_FUS_Operator.bin
00:12:47 : File : 0x495_FUS_Operator.bin
00:12:47 : Size : 11584 Bytes
00:12:47 : Address : 0x08000000
00:12:47 : Erasing memory corresponding to segment 0:
00:12:47 : Erasing internal memory sectors [0 2]
00:12:47 : failed to erase memory
00:12:47 : failed to erase memory
00:12:47 : Failed to download FUS operator!
00:12:47 : Retry -- 2