cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to update FUS or flash the wireless stack STM32WB55

ALu.3
Associate II

H,

I just had some custom boards with STM32WB55CG and I would like to flash the BLE stack into the microcontroller. For some reason the STM32CubeProgrammer does not allow me to flash the FUS or BLE stack files, it always comes back with warning/errors like FUS_STATE_IMG_NOT_FOUND and Operation exceeds memory limits. I am not sure what is the solution now. Any idea would be really helpful, thanks.

The software I use is STM32CubeProgrammer, with ST-Link SWD mode, tried both CLI and GUI

When I read the FUS version the version data is actually loaded @0x20010010. Version 1.1.1.0

According to https://github.com/STMicroelectronics/STM32CubeWB Realse note

Note: when FUS is not running but FUS operator used, you can read FUS version @0x20010010

But I am not sure what does it mean.

Some Options bytes value:

SFSA: 0xf4 (Addr: 0x080f4000)

SBRSA: 0x0 (Addr: 20030000)

SNBRSA: 0x10 (Addr: 2003c000)

SBRV: 0x3d00

Logs:

/* Read FUS version */

10:31:31 : ST-LINK SN : 49FF6F066775545529571767

10:31:31 : ST-LINK FW : V2J38S7

10:31:31 : Board    : --

10:31:31 : Voltage   : 2.84V

10:31:31 : SWD freq  : 4000 KHz

10:31:31 : Connect mode: Normal

10:31:31 : Reset mode : Software reset

10:31:31 : Device ID  : 0x495

10:31:31 : Revision ID : Rev Y

10:31:31 : Debug in Low Power mode enabled.

10:31:31 : UPLOADING OPTION BYTES DATA ...

10:31:31 :  Bank     : 0x00

10:31:31 :  Address    : 0x58004020

10:31:31 :  Size     : 96 Bytes

10:31:31 :  Bank     : 0x01

10:31:31 :  Address    : 0x58004080

10:31:31 :  Size     : 8 Bytes

10:31:31 : UPLOADING ...

10:31:31 :  Size     : 1024 Bytes

10:31:31 :  Address    : 0x8000000

10:31:31 : Read progress:

10:31:31 : Data read successfully

10:31:31 : Time elapsed during the read operation is: 00:00:00.007

10:31:43 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.

10:31:43 : Warning: Option Byte: nboot0, value: 0x1, was not modified.

10:31:43 : Warning: Option Byte: nboot1, value: 0x1, was not modified.

10:31:43 : Warning: Option Bytes are unchanged, Data won't be downloaded

10:31:43 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1 

10:31:43 : Memory Programming ...

10:31:43 : Opening and parsing file: 0x495_FUS_Operator.bin

10:31:43 :  File     : 0x495_FUS_Operator.bin

10:31:43 :  Size     : 8 KBytes

10:31:43 :  Address    : 0x08000000 

10:31:43 : Erasing memory corresponding to segment 0:

10:31:43 : Erasing internal memory sectors [0 1]

10:31:43 : Download in Progress:

10:31:43 : File download complete

10:31:43 : Time elapsed during download operation: 00:00:00.292

10:31:43 : Application is running, Please Hold on...

10:31:43 : Reconnecting...

10:31:43 : Reconnected !

10:31:44 : FUS_STATE_IDLE

10:31:44 : Read FUS state command execution finished

10:31:44 : UPLOADING ...

10:31:44 :  Size     : 4 Bytes

10:31:44 :  Address    : 0x20010010

10:31:44 : Read progress:

10:31:44 : Data read successfully

10:31:44 : Time elapsed during the read operation is: 00:00:00.001

/* Update FUS version */

10:31:56 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.

10:31:56 : Warning: Option Byte: nboot0, value: 0x1, was not modified.

10:31:56 : Warning: Option Byte: nboot1, value: 0x1, was not modified.

10:31:56 : Warning: Option Bytes are unchanged, Data won't be downloaded

10:31:56 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1 

10:31:56 : Memory Programming ...

10:31:56 : Opening and parsing file: 0x495_FUS_Operator.bin

10:31:56 :  File     : 0x495_FUS_Operator.bin

10:31:56 :  Size     : 8 KBytes

10:31:56 :  Address    : 0x08000000 

10:31:56 : Erasing memory corresponding to segment 0:

10:31:56 : Erasing internal memory sectors [0 1]

10:31:56 : Download in Progress:

10:31:56 : File download complete

10:31:56 : Time elapsed during download operation: 00:00:00.293

10:31:56 : Application is running, Please Hold on...

10:31:56 : Reconnecting...

10:31:56 : Reconnected !

10:32:00 : Reconnecting...

10:32:00 : Reconnected !

10:32:02 : StartFus activated successfully

10:32:02 : FUS_STATE_IDLE

10:32:02 : Start FUS execution finished

10:32:06 : Old Firmware delete ...

10:32:06 : Warning: Option Byte: nSWboot0, value: 0x0, was not modified.

10:32:06 : Warning: Option Byte: nboot0, value: 0x1, was not modified.

10:32:06 : Warning: Option Byte: nboot1, value: 0x1, was not modified.

10:32:06 : Warning: Option Bytes are unchanged, Data won't be downloaded

10:32:06 : Succeeded to set nSWboot0=0 nboot1=1 nboot0=1 

10:32:06 : Memory Programming ...

10:32:06 : Opening and parsing file: 0x495_FUS_Operator.bin

10:32:06 :  File     : 0x495_FUS_Operator.bin

10:32:06 :  Size     : 8 KBytes

10:32:06 :  Address    : 0x08000000 

10:32:06 : Erasing memory corresponding to segment 0:

10:32:06 : Erasing internal memory sectors [0 1]

10:32:06 : Download in Progress:

10:32:06 : File download complete

10:32:06 : Time elapsed during download operation: 00:00:00.296

10:32:06 : Application is running, Please Hold on...

10:32:13 : Reconnecting...

10:32:13 : Reconnected !

10:32:13 : Warning: FUS_STATE_IMG_NOT_FOUND, Flash already empty !

10:32:14 : Firmware delete Success

10:32:14 : Download Stack/FUS image at address 0x80ec000 ...

10:32:14 : Memory Programming ...

10:32:14 : Opening and parsing file: stm32wb5x_FUS_fw.bin

10:32:14 :  File     : stm32wb5x_FUS_fw.bin

10:32:14 :  Size     : 122134 Bytes

10:32:14 :  Address    : 0x080EC000 

10:32:14 : Erasing memory corresponding to segment 0:

10:32:14 : Operation exceeds memory limits

10:32:14 : failed to erase memory

10:32:14 : Error: Failed to download image!

/* Flash the BLE stack */

10:32:30 : UPLOADING ...

10:32:30 :  Size     : 4 Bytes

10:32:30 :  Address    : 0x1FFF8070

10:32:30 : Read progress:

10:32:30 : Data read successfully

10:32:30 : Time elapsed during the read operation is: 00:00:00.001

10:32:39 : Download Stack/FUS image at address 0x80ca000 ...

10:32:39 : Memory Programming ...

10:32:39 : Opening and parsing file: stm32wb5x_BLE_Stack_full_fw.bin

10:32:39 :  File     : stm32wb5x_BLE_Stack_full_fw.bin

10:32:39 :  Size     : 122507 Bytes

10:32:39 :  Address    : 0x080CA000 

10:32:39 : Erasing memory corresponding to segment 0:

10:32:39 : Erasing internal memory sectors [202 231]

10:32:40 : Download in Progress:

10:32:42 : File download complete

10:32:42 : Time elapsed during download operation: 00:00:02.864

10:32:42 : Firmware Upgrade process started ...

10:32:42 : Application is running, Please Hold on...

10:32:54 : Reconnecting...

10:32:54 : Reconnected !

10:32:54 : Error: FUS_STATE_IMG_NOT_FOUND

9 REPLIES 9
Amel NASRI
ST Employee

Hi @ALu.3​ ,

I suggest you to follow the steps as described in the eLearning WB Bluetooth mesh - 4 STM32CubeWB Bluetooth LE Stack installation.

Relevant details for you start at 1:55.

-Amel

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.

ALu.3
Associate II

0693W00000D2KvhQAF.jpgHi @Amel NASRI​ .

Thanks for the info I will check it out

Angus

ALu.3
Associate II

Hi @Amel NASRI​ ,

It seems like I already followed the instructions but errors still happen, like FUS_STATE_IMG_NOT_FOUND and Operation exceeds memory limits

Angus

Amel NASRI
ST Employee

Hi @ALu.3​ ,

Check this new link please and look for the 4th course WB Bluetooth mesh - 4 STM32CubeWB Bluetooth LE Stack installation.

Or, from navigational bar, go to Academy > eLearning Catalog > General Purpose Microcontrollers > STM32 Wireless BLE > Board installation and Materials overview > WB Bluetooth mesh - 4 STM32CubeWB Bluetooth LE Stack installation.

That is the learning content recently introduced in the Community.

-Amel

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.

ALu.3
Associate II

Hi @Amel NASRI​ ,

I checked through the video and confirm that I followed the instructions, but errors still come up.

Angus

Hi @ALu.3​ ,

FUS_STATE_IMG_NOT_FOUND error is returned by FUS if no wireless stack is installed and a delete request is sent, informing that no wireless stack was found.

This is how this error state is explained in AN5185 (ST firmware upgrade services for STM32WB Series).

Have a look to this discussion also, you may find some hints.

If problem is still there, we will need the help of our STM32WB expert, so please keep us informed on the status.

-Amel

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.

Guillaume K
ST Employee

hello

> SFSA: 0xf4 (Addr: 0x080f4000)

it's strange, SFSA should be the start of the BLE firmware (0x080CA000 for stm32wb5x_BLE_Stack_full_fw.bin from Cube WB FW package V1.12.0)

what version of Cube WB FW package are you using ? 1.12.0 ?

which kind of BLE firmware are you trying to flash ? stm32wb5x_BLE_Stack_full_fw.bin ?

my option bytes values : (for a STM32WB5MM updated to FUS 1.2.0 and stm32wb5x_BLE_Stack_full_fw.bin v1.12.0):

SFSA: 0xca (Addr: 0x080ca000)

SBRSA: 0xa (0x20032800)

SNBRSA: 0xf (0x2003bc00)

SBRV: 0x32800

busadhruv
Associate II

I am trying to flash/write/program BlE stack using openocd on custom board.
controller is stm32wb5mmgh6tr

i am trying this command in makefile.

flash_ble_stack:
    openocd -f opocd.cfg \
    -c "init" \
    -c "reset halt" \
    -c "flash protect 0 0 last off" \
    -c "flash erase_sector 0 206 243" \
    -c "flash write_image stm32wb5x_BLE_Stack_full_fw.bin 0x080CE000 bin" \
    -c "reset halt" \
    -c "resume" \
    -c "exit"

i have also file  opocd.cfg inside that this two line written.
source [find interface/stlink-v2.cfg]
source [find target/stm32wbx.cfg]


when i run/fire this command in terminal then if on address(0x080CE000) if not already flash anything then it flash BLE stack and i got log 
make flash_ble_stack 

here is log

openocd -f opocd.cfg \
-c "init" \
-c "reset halt" \
-c "flash protect 0 0 last off" \
-c "flash write_image stm32wb5x_BLE_Stack_full_fw.bin 0x080CE000 bin" \
-c "verify" \
-c "reset halt" \
-c "resume" \
-c "exit"
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
WARNING: interface/stlink-v2.cfg is deprecated, please switch to interface/stlink.cfg
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 500 kHz
Info : STLINK V2J42S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.186937
Info : stm32wbx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wbx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08009cd8 msp: 0x20030000
Info : device idcode = 0x20036495 (STM32WB5x - Rev 'unknown' : 0x2003)
Info : flash size = 1024kbytes
Info : flash mode : single-bank
cleared protection for sectors 0 through 255 on flash bank 0

Info : Padding image section 0 at 0x080f30b4 with 4 bytes (bank write end alignment)
wrote 151736 bytes from file stm32wb5x_BLE_Stack_full_fw.bin in 4.962069s (29.862 KiB/s)

And for confirmation i checked memory address in stm32cubeprogrammer applicaion as well as i open that BLE stack .bin file for confirming see both attached photo.

but in that FUS if i click read fus info button then it say version of stack is 0.0 why? see attached photo.

and then i flash my actual application code.

Question / Doubt:
is there any further process start ble stack or any steps that i missed.
why that ble device not showing any ble sniffer mobile application.

Hi @Guillaume K @Amel NASRI 

 

I have the error of "Warning: FUS_STATE_IMG_NOT_FOUND, Flash already empty !" and I am using the latest v1.19. Is there a way to resolve this issue? I know this issue had no solution yet. 

 

thanks,

YJ