Skip to content

Commit eea6e84

Browse files
FRASTMfpistm
authored andcommitted
Activate default clocks on the STM32WB
Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent 4867274 commit eea6e84

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

Diff for: src/utility/HCISharedMemTransport.cpp

+17-7
Original file line numberDiff line numberDiff line change
@@ -553,13 +553,23 @@ 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();
562-
}
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 */
570+
}
571+
572+
LL_PWR_DisableBkUpAccess();
563573

564574
/* Switch OFF LSI as LSE is the source clock */
565575
LL_RCC_LSI2_Disable();

0 commit comments

Comments
 (0)