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 2022/07/20 11:56:05 UTC

[GitHub] [incubator-nuttx] Ouss4 opened a new pull request, #6645: arch/esp32: Introduce the ESP32_RTC option.

Ouss4 opened a new pull request, #6645:
URL: https://github.com/apache/incubator-nuttx/pull/6645

   ## Summary
   Build the RTC modile when ESP32_RTC is enabled instead of the DRIVER_RTC option, because some of the features might be needed without the upperhalf driver.
   ## Impact
   ESP32
   ## Testing
   ESP32 defconfigs
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko merged pull request #6645: arch/esp32: Introduce the ESP32_RTC option.

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged PR #6645:
URL: https://github.com/apache/incubator-nuttx/pull/6645


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6645: arch/esp32: Introduce the ESP32_RTC option.

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #6645:
URL: https://github.com/apache/incubator-nuttx/pull/6645#discussion_r925536390


##########
arch/xtensa/src/esp32/Kconfig:
##########
@@ -1423,6 +1389,48 @@ config ESP32_FREERUN
 endmenu # Timer/counter Configuration
 endif # ESP32_TIMER
 
+menu "RTC Configuration"
+	depends on ESP32_RTC
+
+choice ESP32_RTC_CLK_SRC
+	prompt "RTC clock source"
+	default ESP32_RTC_CLK_SRC_INT_RC
+	---help---
+		Choose which clock is used as RTC clock source.
+
+		- "Internal 150kHz oscillator" option provides lowest deep sleep current
+			consumption, and does not require extra external components. However
+			frequency stability with respect to temperature is poor, so time may
+			drift in deep/light sleep modes.
+		- "External 32kHz crystal" provides better frequency stability, at the
+			expense of slightly higher (1uA) deep sleep current consumption.
+		- "External 32kHz oscillator" allows using 32kHz clock generated by an
+			external circuit. In this case, external clock signal must be connected
+			to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal,
+			and <1V in case of square wave signal. Common mode voltage should be
+			0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
+			Additionally, 1nF capacitor must be connected between 32K_XP pin and
+			ground. 32K_XP pin can not be used as a GPIO in this case.
+		- "Internal 8.5MHz oscillator divided by 256" option results in higher
+			deep sleep current (by 5uA) but has better frequency stability than
+			the internal 150kHz oscillator. It does not require external components.
+
+	config ESP32_RTC_CLK_SRC_INT_RC
+		bool "Internal 150kHz RC oscillator"
+
+	config ESP32_RTC_CLK_SRC_EXT_XTAL
+		bool "External 32kHz crystal"
+		select ESP_SYSTEM_RTC_EXT_XTAL
+
+	config ESP32_RTC_CLK_SRC_EXT_OSC
+		bool "External 32kHz oscillator at 32K_XN pin"
+
+	config ESP32_RTC_CLK_SRC_INT_8MD256
+		bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"

Review Comment:
   Please remove leading TABs for this block



##########
arch/xtensa/src/esp32/esp32_rtc.c:
##########
@@ -157,13 +157,11 @@
   .fe_pd = (val), \
 }
 
-#ifdef CONFIG_RTC_DRIVER
 /* The magic data for the struct esp32_rtc_backup_s that is in RTC slow
  * memory.
  */
 
-#  define MAGIC_RTC_SAVE (UINT64_C(0x11223344556677))
-#endif
+#define MAGIC_RTC_SAVE (UINT64_C(0x11223344556677))

Review Comment:
   minor
   ```suggestion
   #define MAGIC_RTC_SAVE UINT64_C(0x11223344556677)
   ```



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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


[GitHub] [incubator-nuttx] Ouss4 commented on a diff in pull request #6645: arch/esp32: Introduce the ESP32_RTC option.

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on code in PR #6645:
URL: https://github.com/apache/incubator-nuttx/pull/6645#discussion_r925550836


##########
arch/xtensa/src/esp32/esp32_rtc.c:
##########
@@ -157,13 +157,11 @@
   .fe_pd = (val), \
 }
 
-#ifdef CONFIG_RTC_DRIVER
 /* The magic data for the struct esp32_rtc_backup_s that is in RTC slow
  * memory.
  */
 
-#  define MAGIC_RTC_SAVE (UINT64_C(0x11223344556677))
-#endif
+#define MAGIC_RTC_SAVE (UINT64_C(0x11223344556677))

Review Comment:
   Fixed, thanks.



##########
arch/xtensa/src/esp32/Kconfig:
##########
@@ -1423,6 +1389,48 @@ config ESP32_FREERUN
 endmenu # Timer/counter Configuration
 endif # ESP32_TIMER
 
+menu "RTC Configuration"
+	depends on ESP32_RTC
+
+choice ESP32_RTC_CLK_SRC
+	prompt "RTC clock source"
+	default ESP32_RTC_CLK_SRC_INT_RC
+	---help---
+		Choose which clock is used as RTC clock source.
+
+		- "Internal 150kHz oscillator" option provides lowest deep sleep current
+			consumption, and does not require extra external components. However
+			frequency stability with respect to temperature is poor, so time may
+			drift in deep/light sleep modes.
+		- "External 32kHz crystal" provides better frequency stability, at the
+			expense of slightly higher (1uA) deep sleep current consumption.
+		- "External 32kHz oscillator" allows using 32kHz clock generated by an
+			external circuit. In this case, external clock signal must be connected
+			to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal,
+			and <1V in case of square wave signal. Common mode voltage should be
+			0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude.
+			Additionally, 1nF capacitor must be connected between 32K_XP pin and
+			ground. 32K_XP pin can not be used as a GPIO in this case.
+		- "Internal 8.5MHz oscillator divided by 256" option results in higher
+			deep sleep current (by 5uA) but has better frequency stability than
+			the internal 150kHz oscillator. It does not require external components.
+
+	config ESP32_RTC_CLK_SRC_INT_RC
+		bool "Internal 150kHz RC oscillator"
+
+	config ESP32_RTC_CLK_SRC_EXT_XTAL
+		bool "External 32kHz crystal"
+		select ESP_SYSTEM_RTC_EXT_XTAL
+
+	config ESP32_RTC_CLK_SRC_EXT_OSC
+		bool "External 32kHz oscillator at 32K_XN pin"
+
+	config ESP32_RTC_CLK_SRC_INT_8MD256
+		bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)"

Review Comment:
   Fixed, thanks.



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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