[riot-notifications] [RIOT-OS/RIOT] cpu/stm32l4: configure and initialize MCO (#15064)

Alexandre Abadie notifications at github.com
Thu Nov 5 11:32:09 CET 2020

@aabadie commented on this pull request.

> +    /* Enable the LSE is required for MCO */
+        stmclk_dbp_unlock();
+        while (!(RCC->BDCR & RCC_BDCR_LSERDY)) {}
+        stmclk_dbp_lock();
+    }
+    /* Enable the LSI is required for MCO */
+#if defined(CPU_FAM_STM32WB)
+        RCC->CSR |= RCC_CSR_LSI1ON;
+        while (!(RCC->CSR & RCC_CSR_LSI1RDY)) {}
+        RCC->CSR |= RCC_CSR_LSION;
+        while (!(RCC->CSR & RCC_CSR_LSIRDY)) {}
+    }

RTT and RTC can use LSE or LSI, depending on the availability of an LSE on the board. So we could indeed be smarter, and:
-  enable LSE when RTT/RTC is used and the board provides an LSE or when it's used for MCO
-  enable LSI when RTT/RTC is used but the board has no LSE or when it's used for MCO

That would also need to adapt the RTT/RTC peripherals implementations. The problem is that they are common so this can only be done once all families are adapted. Since MCO is disabled by default, I think it's ok to wait until this is done.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20201105/295e80ce/attachment.htm>

More information about the notifications mailing list