cancel
Showing results for 
Search instead for 
Did you mean: 

Wireless stack update process & fault recovery.

LPala.2
Associate

I have a customer that wants to update the wireless stack on their custom assy. This has been implemented successfully following the procedure set detailed in AN5185. Please note that this is not an OTA upgrade and the stack is upgraded via application code using the FUS_FW_UPGRADE with the stack loaded in the non locked area of flash.

During performance testing we are looking for the system to gracefully recover if a "power event / power cycle" occurs during the upgrade process. Although there is a specific error code for a power cycle or user abort, we are finding that the system does not appear to recover well if the power event happens while the cpu is acting on the FUS_FW_UPGRADE process.

Any advice on error handling or further detail about the process would be helpful and appreciated.

I also noticed that the OTA example provided includes the command SHCI_C2_FUS_FwUpgrade(0,0); (both source and destination addresses are set to 0) . What does this do and why was this done.

Thanks

4 REPLIES 4
Remi QUINTIN
ST Employee

It is possible to recover from power cut during a programming phase.

There are 3 cases

  1. No impact: The FUS is able to recover lone when the Flash memory is not corrupted. No action required.
  2. Corruption: The content of the Flash memory is corrupted. The FUS does not install the corrupted image. The FUS erases the memory content and a FUS_ERR_IMG_CORRUPT error code is issued. The customer must launch the programming operation again by uploading the binary and triggering the FUS to install the firmware.
  3. Corruption of the option bytes: Not always possible to recover. The SafeBoot process locked the complete Flash memory. It is not possible to recover with the old FUS versions. If FUS V1.1.0 is installed, then a factory reset is possible. To activate this, just write at address @0x5800040c the value 0x00008000 instead of 0x00000000. This triggers the CM0+ core to perform this factory reset.

LPala.2
Associate

Remi,

Thanks for the quick and comprehensive reply. Can tell me about the SHCI_C2_FUS_FwUpgrade(0,0); command. The docs and code do not indicate what this function does when both the source and destination addresses are 0.

Remi QUINTIN
ST Employee

This function is of no use currently. It is ony there for future use.

ATaba.1
Associate II

Hi @LPala.2​ & @Remi QUINTIN​ 

I am working on a similar project. I am not doing the OTA firmware upgrade but storing my new stack image 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, 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 following steps:
  • Call SHCI_C2_FUS_GetState(0);
    • 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