Skip to content

Commit afeccd3

Browse files
FRASTMfpistm
authored andcommitted
Activate default clocks on the STM32WB
Signed-off-by: Francois Ramu <[email protected]>
1 parent 4867274 commit afeccd3

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/utility/HCISharedMemTransport.cpp

+16-6
Original file line numberDiff line numberDiff line change
@@ -553,14 +553,24 @@ size_t HCISharedMemTransportClass::write(const uint8_t *data, size_t length)
553553
//private:
554554
void HCISharedMemTransportClass::start_ble_rf(void)
555555
{
556-
if ((LL_RCC_IsActiveFlag_PINRST()) && (!LL_RCC_IsActiveFlag_SFTRST())) {
557-
/* Simulate power off reset */
558-
LL_PWR_EnableBkUpAccess();
559-
LL_PWR_EnableBkUpAccess();
560-
LL_RCC_ForceBackupDomainReset();
561-
LL_RCC_ReleaseBackupDomainReset();
556+
/* Set the DBP bit in the Power control register 1 (PWR_CR1) */
557+
LL_PWR_EnableBkUpAccess();
558+
559+
/* LSE belongs to the back-up domain, enable access.*/
560+
while (!LL_PWR_IsEnabledBkUpAccess()) {
561+
/* Wait for Backup domain access */
562+
}
563+
LL_RCC_ForceBackupDomainReset();
564+
LL_RCC_ReleaseBackupDomainReset();
565+
566+
/* Enable LSE Oscillator (32.768 kHz) */
567+
LL_RCC_LSE_Enable();
568+
while (!LL_RCC_LSE_IsReady()) {
569+
/* Wait for LSE ready */
562570
}
563571

572+
LL_PWR_DisableBkUpAccess();
573+
564574
/* Switch OFF LSI as LSE is the source clock */
565575
LL_RCC_LSI2_Disable();
566576
}

0 commit comments

Comments
 (0)