Custom loader for SBSFU / STM32WB5MMG - how to run FUS?
I am building a custom loader for SBSFU on the STM32WB5MMG. The loader is similar to the BLE_Ota loader, but instead of using BLE, it loads firmware/wireless stack from an onboard microSD card, as well as being able to write CKS keys.
I do need to have FUS or the stack running, so that I can write CKS keys.
Ideally, I think I want to run FUS, since I don't need a BLE interface. However, the last thing SBSFU does before it runs the standalone loader is to lock services, which includes running the wireless stack if FUS is running.
This means that if I reset into FUS in my loader, SBSFU will always start the wireless stack before launching the loader again--preventing me from using FUS in the loader.
I could hack out the bit of code that starts the wireless stack before running the standalone loader, but I've tried to make as few changes to SBSFU as possible, to maintain its integrity, and I'm particularly hesitant to make changes to SECoreBin.
I thought I might be able to add STM32_WPAN to the loader, but not enable any of the built-in templates. However, I think this leaves the wireless stack in an unexpected state, and when I do this the wireless stack doesn't start correctly in my application--SHCI_C2_BLE_Init hangs, if I remember correctly. If I remove power from the board and then reconnect, so that execution doesn't go through the loader, everything works fine.
So, I think I'm looking for guidance either on loading FUS in a custom loader, or on building a minimal BLE application with no actual interface so that I can write CKS keys.
Any help would be greatly appreciated. Thank you!
