cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55MMG Cannot Start FUS form running firmware to wirelessly update BLE stack

SAli.8
Associate II

Respected Members,

We are using STM32Cube Package 1.16.0 and STM32CubeIDE v1.12.1. We have 10,000 devices in market with BLE stack v1.16.0 and FUS v1.2.0 (STM32WB5MMG). We encountered a BLE related disconnection bug that was resolved when we switch to BLE stack v1.21.0 so now the idea is to wirelessly OTA BLE stack of CM0+ and firmware binary of CM4+.

But the problem is that whenever I make a call to FUS using SHCI_C2_FUS_GetState(NULL), it is blocked and keeps waiting on shci_send( SHCI_OPCODE_C2_FUS_GET_STATE, 0, 0, p_rsp ); This call never returns if I check with debugger (STLINK-V3 using IDE attached).

Now, if I manually start FUS from CubeProgrammer, then re-run the firmware, FUS get state works but I cannot do this on working devices deployed in the field. If BLE stack is running, I cannot seem to get this call SHCI_C2_FUS_GetState(NULL) to work.

The startup script and linker script is attached as well along with .ioc file used to generate project (wb_1.21.0.zip). This project is using CubeWB v1.21.0. The behavior with CubeWB 1.16.0 is also same on my side. You can check my UART traces from BLE stack as well below:

SAli8_0-1744621685760.png

The main is as follows, attached.

Any help will be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
FilipKremen
ST Employee

Hello,

please use the command SHCI_C2_FUS_FwUpgrade() with zero parameters. The parameters are not used.

Regarding the location, FUS can locate it due to image footers. Please read more information in section 6.4.

How to use STMicroelectronics firmware upgrade services for STM32WB MCUs - Application note

 

Best regards,

ST support

 

View solution in original post

5 REPLIES 5
FilipKremen
ST Employee

Hello,

please don't call this function in the main. In the while loop, there should be only MX_APPE_Process() function.

I recommend having a look at BLE_Ota example where you find how it's implemented.

(Please check the otas_app.c file)

Also, please have a look at these links below which can be helpful for your implementation.

How to build wireless applications with STM32WB MCUs - Application note

Over-the-air application and wireless firmware update for STM32WB series microcontrollers - Application note

 

Best regards,

ST support

Thanks for your reply. I looked into BLE_OTA example in detail. I have already achieved a lot but I get stuck at this API.

SHCI_C2_FUS_FwUpgrade(0,0).

In example, we are not giving it any start and destination address of BLE stack downloaded. But API takes addresses. How the FUS knows where in flash BLE stack downloaded via wireless OTA packets is present?

@FilipKremen 
SAli.8
Associate II
I used SHCI_C2_FUS_FwUpgrade(free_area_address, mem::kBleStackExecAddress);

free_area_address = 0x08052000

mem::kBleStackExecAddress = 0x080D0000

I put BLE stack downloaded via my OTA implementation in free_area_address, now I start FUS and let it know via SHCI_C2_FUS_FwUpgrade to upgrade BLE stack. Our current stack is v1.16.0 and we are going to v1.21.0 hence release notes address taken from v1.21.0 for BLE stack (full).


When I provide any free flash area used as free space or scratch to this API, SFSA changes to that free area address.

SAli8_0-1744884550582.png


This locks this area forever and I using my code or STM32CubeProgrammer cannot read or erase this area ever again.

SAli8_1-1744884597452.png

 

FilipKremen
ST Employee

Hello,

please use the command SHCI_C2_FUS_FwUpgrade() with zero parameters. The parameters are not used.

Regarding the location, FUS can locate it due to image footers. Please read more information in section 6.4.

How to use STMicroelectronics firmware upgrade services for STM32WB MCUs - Application note

 

Best regards,

ST support

 

SAli.8
Associate II

Thanks @FilipKremen. I now understand FUS usage and this API. I have managed to upgrade my BLE stack.

Now, issue is that when I start image after bootloader, I do not receive SHCI_SUB_EVT_CODE_READY in image after jumping. I read about usage of SHCI_C2_Reinit() but could not resolve the issue. Can you hint me in right direction.

Ref:
https://community.st.com/t5/stm32-mcus-wireless/need-to-know-correct-usage-or-example-code-for-shci-c2-reinit/m-p/795899#M24448