Skip to main content
August 16, 2020
Question

STM342WB55 after load last BLE stack (1.8.0) I can`t erase fw with STM32CubeProgrammer

  • August 16, 2020
  • 65 replies
  • 10272 views

Hi.

Using STM32CubeProgrammer I load last stm32wb5x_BLE_Stack_light_fw.bin, but when after that I try to run command -fwdelete, I get an error : "FUS_NOT_RUNNING".

I attach log file becose Idont understand whot is this.

But me application work fine and I see that stack is a last version.

Please help whot may bee .

I send call:

STM32_Programmer_CLI.exe -c port=usb1 -fwdelete -vb 3

This topic has been closed for replies.

65 replies

September 2, 2020

Where I can find FUS state and status description?

Like what I see in log:

 4:10:00:605 : DFU status = 0

14:10:00:605 : DFU State = 4

14:10:00:605 : DFU status = 0

14:10:00:605 : DFU State = 5

14:10:00:616 : DFU status = 0

14:10:00:616 : DFU State = 9

September 2, 2020

Result:

In our custom FW I add code:

SHCI_C2_FUS_GetState(NULL);

SHCI_C2_FUS_GetState(NULL);

while (1)

{

HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);

}

After that

0693W000003QanmQAC.png

ESE stay reset.

And now i can delete stack, load stack 1.6.0 and all work fine.

But when I try to load 1.8.0

GUI tell me an error:

18:41:42 : Time elapsed during download operation: 00:00:02.738

18:41:42 : FUS state is FUS_IDLE

18:41:42 : FUS status is FUS_NO_ERROR

18:41:45 : Firmware Upgrade process started ...

18:41:45 : Updating firmware ...

18:41:45 : Waiting for firmware upgrade end

18:41:45 : FUS state is WIRELESS_STACK_UPGRADE_ONGOING

18:41:45 : FUS status is FUS_NO_ERROR

...

18:43:51 : FUS state is WIRELESS_STACK_UPGRADE_ONGOING

18:43:51 : FUS status is FUS_NO_ERROR

18:43:53 : Firmware upgrade Error!

After that FUS state is:

WIRELESS_STACK_UPGRADE

FUS_NO_ERROR

Then I load stack light 1.6.0 on address 0x80D9000 and GUI abort connection.

Same situation from CLI.

And error is

FUS_ERROR

FUS_NOT_RUNNING

Next, I run my custom FW with calling SHCI_C2_FUS_GetState(NULL) , reset chip and FUS set to FUS_IDLE

and now I can load 1.6.0 stack light.

I do not understand what is happening, but it is clear that:

1.Сube programmer does not start the FUS correctly (I can start it from my application)

2.stack 1.8.0 somehow affects the work of FUS.

September 10, 2020

Now, using my custom android application, my custom OTA DFU bootloader I have successfully updated the stack from 1.6.0 to 1.8.0 and then from 1.8.0 to 1.6.0 on a chip with 1M flash.

This confirms my suspicion that something is wrong with the STMCubeProgrammer.

Later I will do the same with the 512k chip.

Mecanix
Associate III
October 15, 2020

Had luck using CLI with SWD + the NRST pin hooked up. Does the stack fwdelete & fwupgrade without any issues now. Option PCROP.RDP byte is set to 1.

See if you can replicate

(STM32CubeProgrammer API v2.3.0).

Remi QUINTIN
ST Technical Moderator
October 15, 2020

Please use CubeProgrammer v2.5 that you can download from the www.st.com ​web site.

October 15, 2020

I use 2.5 and still have this problem.

Mecanix
Associate III
October 15, 2020

I can't replicate this at this very moment, but remember from last week having similar misbehaving deletes and upgrades when using port=usb1. It kept resetting and trying again populating an error nearly back to back after each retries. I've since switched to port=swd and also have the NRST pin attached and now both the fwdelete & fwupgrade works perfectly fine. Note that I've set PCROP.RDP byte to 1.

Please give this identical set-up a go and see if this works fine for you too. If it doesn't then may I suggest you look at your hardware between CubeProgrammer and the chip (cable, pc/laptop usb port, and/or drivers).

ps. confirmed working with STM32CubeProgrammer API v2.3.0. I might give 2.5 a try the next time I need to flash those bad boyz. Thanks for the heads up @Remi QUINTIN​