STMicroelectronics / STM32CubeWB

Full Firmware Package for the STM32WB series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects (examples and demos) running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits).
https://www.st.com/en/embedded-software/stm32cubewb.html
Other
219 stars 134 forks source link

CFG_LPM_SUPPORTED Abnormal during connection, There is a probability of getting stuck when exiting stop2 mode. #89

Open IC-killer opened 5 months ago

IC-killer commented 5 months ago

Describe the set-up STM32WB55CGU6 (Custom board) STM32Cube_FW_WB_V1.17.3 (stm32wb5x_BLE_Stack_full_fw.bin, stm32wb5x_FUS_fw.bin)

Describe the bug when I enable CFG_LPM_SUPPORTED, there is a probability that the Bluetooth connection will get stuck at LL_HSEM_ReleaseLock(HSEM, CFG_HW_ENTRY_STOP_MODE_SEMID, 0) when exit stop2 mode.

I found that this link has the same issue as mine. link, but my flash and CPU2 clock frequencies are the same,, image

this issue does not occur when Bluetooth is not connected. when Bluetooth is connected, the program randomly gets stuck here and cannot recover normally. stm32_lpm_if.c

while(LL_HSEM_1StepLock(HSEM, CFG_HW_RCC_SEMID));

I have already disabled user tasks that are not related to Bluetooth.

ALABSTM commented 5 months ago

Hi @IC-killer,

Thank you for these details. Two question though before digging deeper into this point:

Thank you in advance for the clarifications.

With regards,

IC-killer commented 5 months ago

I have also tested versions 1.18 and 1.19, and encountered the same issue. This problem will definitely occur after a period of operation, but the length of time is uncertain. I don't know what possible reasons might have led to this. Modifying the UTIL_SEQ_Idle() function as in the link below can improve the situation: link Thank you for your reply.

TOUNSTM commented 1 month ago

Hello @IC-killer,

Could you please specify the IDE and its version, along with the smartphone application you are using?

With regards,

IC-killer commented 1 month ago

@TOUNSTM MDK v5.37, cubeMX v6.9.2 and app use ST BLE ToolBox

TOUNSTM commented 2 weeks ago

Hello @IC-killer,

Our development team would appreciate more information about your project. Specifically, it would be helpful to understand your use case in greater detail. For example, it is important to know if you are performing writes or erases in flash memory. You might find it useful to compare your code with the BLE_HeartRate application provided in the STM32CubeWB package, which uses STOP2 mode.

Kind regards,