cancel
Showing results for 
Search instead for 
Did you mean: 

Can I upgrade the STM32WB wireless stack & FUS in a custom application?

ATaba.1
Associate II

Hello,

Thank you for your detailed answers. I have resolved the design concerns related to this.

I need your input for another issue. I am working on upgrading the wireless stack & FUS programmatically. I am NOT doing the OTA firmware upgrade but storing my new stack & FUS images in internal flash memory. The MCU that I am using is STM32WB5xxG(1M). Following are the steps I am following based on the instructions in AN5185 Rev 6.

The pre-condition is that the WS is running (which I think means FUS is running too), BLE is initialized, my custom application is running:

  1. Install the new wireless stack at 0x08078000 (additional encryption added)
  2. Decrypt the new wireless stack from additional encryption
  3. Initiate the upgrade by using FUS commands :
  • Call SHCI_C2_FUS_GetState(0); - Should I still call this if I know that my stack is running?
    • Call SHCI_C2_FUS_FwDelete();
    • Call SHCI_C2_FUS_FwUpgrade(0x08078000, 0x080C7000);

With this, I am not able to flash the new image and the error code from FUS commands is SHCI_UNKNOWN_CMD.

Is this a correct method? Is there an example other than OTA that I can follow?

Thank you,

Arshiya Tabassum

2 REPLIES 2
Remy ISSALYS
ST Employee

Hello,

First when Wireless Stack is running, the FUS is not running. To initiate the upgrade of wireless stack or FUS, you need to start the FUS:

  • To request CPU2 to reboot on FUS, you shall send GetState command twice:

SHCI_C2_FUS_GetState( NULL );

SHCI_C2_FUS_GetState( NULL );

Then FUS is running, the CPU2 firmware update procedure is starting from now. It is advised to perform a FUS_FW_DELETE operation before starting a wireless stack installation:

  • Call SHCI_C2_FUS_FwDelete();

To upgrade the wireless stack or FUS, use FwUpgrade command with 0,0 in parameters:

  • Call SHCI_C2_FUS_FwUpgrade(0,0); 

Send FUS_GET_STATE until a state equal to FUS_STATE_NOT_RUNNING is reached (this means that the wireless stack has been installed and is now running).

During CPU2 firmware upgrade, there may be several device reset and the key word at the beginning of SRAM1 shall be changed CFG_REBOOT_ON_CPU2_UPGRADE.

For Wireless Firmware upgrade, once the upgrade is over, the CPU2 will run the wireless stack. When the wireless stack is running, the SRAM1 is checked and when equal to CFG_REBOOT_ON_CPU2_UPGRADE, it means we may restart on the firmware application.

   

For FUS Firmware Upgrade, once the upgrade is over, the CPU2 will run FUS and the FUS return the Idle state. The SRAM1 is checked and when equal to CFG_REBOOT_ON_CPU2_UPGRADE, it means we may restart on the firmware application.

We can look BLE_Ota example, to see the method used to install new wireless stack or FUS.

Best Regards

Hi, I look the BLE_Ota sample code, and run it with the BLE sensor app.

I have some question to ask.

1. I found that when OTA application send SHCI_C2_FUS_GetState( NULL )  to CPU2 twice to reboot it on FUS. CPU1 will also reboot. Is it a normal phenomenon?

2. When l send SHCI_C2_FUS_FwUpgrade(0,0) and make FUS state is in FUS_STATE_VALUE_FW_UPGRD_ONGOING, sending SHCI_C2_FUS_GetState( NULL )  will also reboot CPU1. Is it a normal phenomenon?

3.Combining the first and second questions,can CPU2 make CPU1 reboot?