From b28128ab106b93e1b58116bda30168c84d579f13 Mon Sep 17 00:00:00 2001 From: Matt Trentini Date: Tue, 9 Aug 2022 00:56:50 +1000 Subject: [PATCH] ports/stm32: Allow HSE to be a wakeup source for BLE for the WB55. --- ports/stm32/rfcore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/stm32/rfcore.c b/ports/stm32/rfcore.c index 05582e887eeb5..2d99a3410baaa 100644 --- a/ports/stm32/rfcore.c +++ b/ports/stm32/rfcore.c @@ -539,8 +539,12 @@ void rfcore_init(void) { while (LL_HSEM_1StepLock(HSEM, CFG_HW_PWR_STANDBY_SEMID)) { } - // Select LSE as RF wakeup source + // Set the wakeup source to LSE or fall back to use HSE + #if MICROPY_HW_RTC_USE_LSE RCC->CSR = (RCC->CSR & ~RCC_CSR_RFWKPSEL) | 1 << RCC_CSR_RFWKPSEL_Pos; + #else + RCC->CSR = (RCC->CSR & ~RCC_CSR_RFWKPSEL) | 3 << RCC_CSR_RFWKPSEL_Pos; + #endif // Initialise IPCC and shared memory structures ipcc_init(IRQ_PRI_SDIO);