@@ -553,13 +553,35 @@ size_t HCISharedMemTransportClass::write(const uint8_t *data, size_t length)
553
553
// private:
554
554
void HCISharedMemTransportClass::start_ble_rf (void )
555
555
{
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
+ /* HW semaphore Clock is enabled for this variant */
557
+ LL_AHB3_GRP1_EnableClock (LL_AHB3_GRP1_PERIPH_HSEM);
558
+
559
+ /* This prevents the CPU2 (M0+) to configure RCC */
560
+ while (LL_HSEM_1StepLock (HSEM, CFG_HW_RCC_SEMID));
561
+
562
+ #ifdef LL_APB1_GRP1_PERIPH_PWR
563
+ /* Enable the power interface clock */
564
+ LL_APB1_GRP1_EnableClock (LL_APB1_GRP1_PERIPH_PWR);
565
+ #endif
566
+ /* Set the DBP bit in the Power control register 1 (PWR_CR1) */
567
+ LL_PWR_EnableBkUpAccess ();
568
+
569
+ /* LSE belongs to the back-up domain, enable access.*/
570
+ while (!LL_PWR_IsEnabledBkUpAccess ()) {
571
+ /* Wait for Backup domain access */
572
+ }
573
+ LL_RCC_ForceBackupDomainReset ();
574
+ LL_RCC_ReleaseBackupDomainReset ();
575
+
576
+ /* Enable LSE Oscillator (32.768 kHz) */
577
+ LL_RCC_LSE_Enable ();
578
+ while (!LL_RCC_LSE_IsReady ()) {
579
+ /* Wait for LSE ready */
580
+ }
581
+
582
+ LL_PWR_DisableBkUpAccess ();
583
+
584
+ LL_HSEM_ReleaseLock (HSEM, CFG_HW_RCC_SEMID, 0 );
563
585
564
586
/* Switch OFF LSI as LSE is the source clock */
565
587
LL_RCC_LSI2_Disable ();
0 commit comments