cancel
Showing results for 
Search instead for 
Did you mean: 

Need to know correct usage or example code for SHCI_C2_Reinit()

SAli.8
Associate II

Hello Respected Members,

I have a bootloader in CPU1 at address 0x08000000 and an image at 0x08024000. I have different BLE services in bootloader and in image. Problem is, once CPU2 has been started by bootloader, it jumps to image and hence the services of image cannot be loaded, BLE stack does not advertise. SHCI_SUB_EVT_CODE_READY event is never received in image as bootloader has already received it.

I read about SHCI_C2_Reinit() in How to build wireless applications with STM32WB MCUs - Application note (AN5289). So, I called it in bootloader before jumping to image. But alas, I still did not get SHCI_SUB_EVT_CODE_READY. I need help in correct usage of this SHCI_C2_Reinit() so I can reinitialize different BLE services in image when jumping from bootloader.

4 REPLIES 4
FilipKremen
ST Employee

Hello,

can you please share the projects or any code snippets?

Thank you.

 

Best regards,

Filip Kremen

GuilhemG
Associate III

Same thing here, did you managed to get something working ?

Thank you

Yes, the trick is in Cortex M4 core, only one binary should initialize BLE stack at a given time otherwise you miss SHCI_SUB_EVT_CODE_READY event from RF core. What we did is that we designed custom bootloader in such a way that when it initializes BLE stack, we complete all what we need by bootloader, save state in flash and do NVIC_Reset. Then based on flag in flash, we do not initialize BLE stack in bootloader and jump to application binary image which now initializes BEL stack. Either way, afetr NVIC Reset, only one binary can initialize BLE stack.

If you need more help, you can email me at omerali@c4micro.com. We designed full product on STM32WB55, might even go FDA route for the medical product with this chip.

Hello,

First of all, thank you very much for your reply and for offering your help!
I'm really starting to get used to struggling with the WB55 series and its… let’s say approximate documentation.

Here’s what I’m doing right now (and what isn’t working):

  • hardware reboot → SBSFU starts → BLE_OTA (stack init OK) → OTA update OK (using ST BLE Sensor)

  • hardware reboot → SBSFU → custom app start (BLE stack init OK) → OTA request received → software reboot → SBSFU → BLE_OTA (stack init fails) → FAIL!

From what I understand, the initialization must only be done once after a hardware reset. NVIC_SystemReset isn’t enough, and SHCI_C2_Reinit() is useless (I tried calling it before and after the soft reset in different places — no change at all…).

I’m going to try storing the “stack initialized” flag in the RTC backup registers so the bootloader doesn’t reinitialize the stack if we’re coming from a software reboot triggered by the application.

There’s still the issue of reconfiguring GAP/GATT, which are different between the bootloader and the application — fingers crossed this isn’t another bug in ST’s BLE stack :’(

It’s pretty crazy that making a Bluetooth product in 2025 is still this complicated with ST chips. Same situation here: medical product, FDA! This job isn’t easy…