You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/03 08:34:20 UTC

[GitHub] [incubator-nuttx] juniskane commented on a change in pull request #2943: stm32x7:lse ensure it is started

juniskane commented on a change in pull request #2943:
URL: https://github.com/apache/incubator-nuttx/pull/2943#discussion_r586213160



##########
File path: arch/arm/src/stm32f7/stm32_lse.c
##########
@@ -100,27 +118,55 @@ void stm32_rcc_enablelse(void)
       regval |= RCC_BDCR_LSEON;
 
 #ifdef CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY
-      /* Set start-up drive capability for LSE oscillator. */
+      /* Set start-up drive capability for LSE oscillator. With the
+       * enable on.
+       */
 
-      regval &= ~RCC_BDCR_LSEDRV_MASK;
-      regval |= CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY <<
-                RCC_BDCR_LSEDRV_SHIFT;
+      regval &= ~(RCC_BDCR_LSEDRV_MASK);
+      regval |= drives[CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY];

Review comment:
       Suppose CONFIG_STM32F7_RTC_LSECLOCK_START_DRV_CAPABILITY is 1 aka MEDHI, but now drives[1] is MEDLO, so selects wrong  capability! Stupid ST silicon designer borked the values used here.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org