Proper way to share peripherals between bootloader and UserApp in SBSFU. STM32WB CPU2 getting stuck.
Hello guys, how are you?
Currently i have an interesting problem happening with my STM32WB5M. I have a project that uses SBSFU alongside with a firmware that uses the BLE peripheral with CPU2 and etc. I don't use the BLE loader, i developed i customize USB loader.
The only peripheral that is shared between bootloader and my user app are 3 GPIOS that i use for a RGB led. The thing is, when i share this resource, sometimes CPU2 get stuck in my main firmware and it doesn't initialize. I need my WDT to kick in and reset the firmware, then CPU2 initializes. The only way things work smooth is when i have my debug connected to the board (i tought this very very weird).
If i remove the GPIO from my bootloader, everything works fine with or without my debug probe. I think the CPU2 behaviour on STM32WB5M very strange. CPU2 get stuck sometimes because of a problem that is not even related to it.
Any suggestion about what this could be? Is there something relevant that i should do to "share" this GPIO's between bootloader and main firmware? Anyone would have a hint about why the CPU2 get stuck for somethings that it doesn't have anything to do with it?
Regards,
Matheus
