@@ -555,11 +555,38 @@ void HCISharedMemTransportClass::start_ble_rf(void)
555
555
{
556
556
if ((LL_RCC_IsActiveFlag_PINRST ()) && (!LL_RCC_IsActiveFlag_SFTRST ())) {
557
557
/* Simulate power off reset */
558
- LL_PWR_EnableBkUpAccess ();
559
- LL_PWR_EnableBkUpAccess ();
560
- LL_RCC_ForceBackupDomainReset ();
561
- LL_RCC_ReleaseBackupDomainReset ();
558
+
562
559
}
560
+
561
+ /* HW semaphore Clock is enabled for this variant */
562
+ LL_AHB3_GRP1_EnableClock (LL_AHB3_GRP1_PERIPH_HSEM);
563
+
564
+ // * This prevents the CPU2 (M0+) to configure RCC */
565
+ while (LL_HSEM_1StepLock (HSEM, CFG_HW_RCC_SEMID));
566
+
567
+ #ifdef LL_APB1_GRP1_PERIPH_PWR
568
+ /* Enable the power interface clock */
569
+ LL_APB1_GRP1_EnableClock (LL_APB1_GRP1_PERIPH_PWR);
570
+ #endif
571
+ /* Set the DBP bit in the Power control register 1 (PWR_CR1) */
572
+ LL_PWR_EnableBkUpAccess ();
573
+
574
+ /* LSE belongs to the back-up domain, enable access.*/
575
+ while (!LL_PWR_IsEnabledBkUpAccess ()) {
576
+ /* Wait for Backup domain access */
577
+ }
578
+ LL_RCC_ForceBackupDomainReset ();
579
+ LL_RCC_ReleaseBackupDomainReset ();
580
+
581
+ /* Enable LSE Oscillator (32.768 kHz) */
582
+ LL_RCC_LSE_Enable ();
583
+ while (!LL_RCC_LSE_IsReady ()) {
584
+ /* Wait for LSE ready */
585
+ }
586
+
587
+ LL_PWR_DisableBkUpAccess ();
588
+
589
+ LL_HSEM_ReleaseLock (HSEM, CFG_HW_RCC_SEMID, 0 );
563
590
564
591
/* Switch OFF LSI as LSE is the source clock */
565
592
LL_RCC_LSI2_Disable ();
0 commit comments