Skip to main content
Visitor
Question

STM32WB5MMG: BLE stack never answers HCI_RESET when RF wake-up clock = LSE (works with HSE/1024)

Questions
1. Are there conditions for using the LSE as RF wake-up / BLE sleep clock on the WB5MM module that we are missing? (LSE drive level, LSE CSS, MOD5MM_DEV flag, LSE stabilization time or ordering relative to C2BOOT / SHCI_C2_BLE_Init, RFWKPSEL write timing)
2. Is there a known issue or erratum with BLE stack 1.24.0 and LsSource 0x02 on STM32WB5MMG?
3. RM0434 says the RF wake-up clock is only available in Stop with the LSE. Is HSE/1024 really unusable when CPU1 uses Stop 1 with an active BLE connection or  advertising, or is there a supported way to do it?

Hardware
- STM32WB5MMG module on a custom PCB, VDD 3.3 V from an LDO (TPS70633). 
- CPU2: BLE Stack full v1.24.0, FUS v2.2.0 (read back from SHCI_GetWirelessFwInfo: stack_type 0x01, release_type 3) 
- Firmware package STM32Cube_FW_WB V1.24.0, CubeIDE 2.1.0, P2P Server based application

Clocks (CPU1)
- SYSCLK 64 MHz: MSI range 6 -> PLL, MSI PLL mode enabled once LSE is ready
- HSE 32 MHz on (radio)
- LSE: module crystal, drive = MEDIUMHIGH; LSERDY measured at ~165 ms (~122 ms with HIGH drive)
- RTC on LSE (RTCSEL = LSE), backup domain reset on first boot after the switch

Failing configuration
- RCC_CSR.RFWKPSEL = LSE (01)
- CFG_BLE_LS_SOURCE = SHCI_C2_BLE_INIT_CFG_BLE_LS_NOCALIB | SHCI_C2_BLE_INIT_CFG_BLE_LS_MOD5MM_DEV | SHCI_C2_BLE_INIT_CFG_BLE_LS_CLK_LSE (= 0x02)
- Sequence: CPU2 ready event received, SHCI_C2_BLE_Init() returns SUCCESS, then the first HCI command, hci_reset() (opcode 0x0C03), never gets a command complete. CPU1 waits forever in UTIL_SEQ_WaitEvt() inside the transport layer. Last command in the TL command buffer is 0x0C03.
- Reproducible on every boot. Same result with MSI PLL mode disabled.

Working configuration 
- RFWKPSEL = HSE/1024 and CFG_BLE_LS_SOURCE = ...CLK_HSE_1024 (0x06)
- BLE starts, advertises and streams normally, RTC still on LSE.

1 reply

Visitor

Update: with RFWKPSEL = LSE we tried LsSource 0x00, 0x01, 0x02 and 0x03 (calibration on/off, module flag on/off). All four behave identically: SHCI_C2_BLE_Init() returns success about 1.0 s after reset, the first HCI command hci_reset() (0x0C03) never gets a command complete, and CPU1 waits in the transport layer until our watchdog resets it. The same board, with only RFWKPSEL = HSE/1024 and LsSource 0x06, starts BLE every time. LSE is running (LSERDY = 1, RTC on LSE, MSI PLL mode locked to it). Is there anything CPU2 requires before it can use the LSE as RF wake-up clock on the WB5MMG module?