Skip to content

Commit ed10763

Browse files
authored
Merge pull request stm32duino#25 from FRASTM/wb55_sem
Activate default clocks on the stm32wb
2 parents 39406aa + afeccd3 commit ed10763

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
@@ -559,14 +559,24 @@ size_t HCISharedMemTransportClass::write(const uint8_t *data, size_t length)
559559
//private:
560560
void HCISharedMemTransportClass::start_ble_rf(void)
561561
{
562-
if ((LL_RCC_IsActiveFlag_PINRST()) && (!LL_RCC_IsActiveFlag_SFTRST())) {
563-
/* Simulate power off reset */
564-
LL_PWR_EnableBkUpAccess();
565-
LL_PWR_EnableBkUpAccess();
566-
LL_RCC_ForceBackupDomainReset();
567-
LL_RCC_ReleaseBackupDomainReset();
562+
/* Set the DBP bit in the Power control register 1 (PWR_CR1) */
563+
LL_PWR_EnableBkUpAccess();
564+
565+
/* LSE belongs to the back-up domain, enable access.*/
566+
while (!LL_PWR_IsEnabledBkUpAccess()) {
567+
/* Wait for Backup domain access */
568+
}
569+
LL_RCC_ForceBackupDomainReset();
570+
LL_RCC_ReleaseBackupDomainReset();
571+
572+
/* Enable LSE Oscillator (32.768 kHz) */
573+
LL_RCC_LSE_Enable();
574+
while (!LL_RCC_LSE_IsReady()) {
575+
/* Wait for LSE ready */
568576
}
569577

578+
LL_PWR_DisableBkUpAccess();
579+
570580
/* Switch OFF LSI as LSE is the source clock */
571581
LL_RCC_LSI2_Disable();
572582
}

0 commit comments

Comments
 (0)