2023-08-02 01:56 AM
Hi,
I have made an application on that needs to enter shutdown/standby mode on the STM32WB10 MCU.
I have successfully made it enter the shutdown mode, and I can wake it back up again.
However, when it wakes up, it does not get any response from CPU2.
It is as if the task "shci_user_evt_proc" is never called in a way that allows it to call "
APPE_SysUserEvtRx()" in app_entry.c
As a result I only have Bluetooth when the MCU is started the first time from a power cycle.
The current version of my application enters standby/shutdown after 10s of no user interaction.
After wakeup, it enters HardFault_Handler() when it attempts to enter shutdown again.
This happens when it attempts to send the command for disabeling the advertising (which i suspect is obvious, since the CPU2 is not responsive).
Below is a screenshot of the stacktrace and the line that causes the hard fault.
I suspect this is caused by my code not doing something the way it should, but I cannot figure out what it should do, or when.
I have tried unchecking the option byte that resets the SRAM2 when a reset occures, this did nothing.
I have tried to disable BLE when booting from wakeup by running this
void DisableBle()
{
uint8_t rfResetStatus = (RCC->CSR & RCC_CSR_RFRSTS) != 0U ? 1 : 0;
LL_APB3_GRP1_ForceReset(LL_APB3_GRP1_PERIPH_RF);
while(!rfResetStatus)
{
rfResetStatus = (RCC->CSR & RCC_CSR_RFRSTS) != 0U ? 1 : 0;
}
RCC->CSR |= RCC_CSR_RMVF;
}
That did nothing.
The ResetCPU2() function that attempts to stop the advertising looks as this
void ResetCpu2()
{
/*stop adv , stop ble stack , reset cpu2 */
// Stop Advertising
hci_le_set_advertising_enable(0);
// Reset the stack
aci_hal_stack_reset();
// Reboot CPU2
SHCI_C2_Reinit();
}
Can anyone point me in the right direction as to what I am doing wrong?
2024-02-29 03:52 AM
Hi, I've exactly the same problem. Does anybody have a fix ?