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/06/30 13:26:04 UTC

[GitHub] [incubator-nuttx] saramonteiro opened a new pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

saramonteiro opened a new pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001


   ## Summary
   
   This PR adds support for different clock sources for RTC controller and closes some pending TODOs from `esp32_rtc.c`.
   These were:
   
   - [x] It is missing the support for choosing the other source clocks to feed the slow_rtc_clk. 
   
   - [x] It is missing to fix the overflow.
   
   - [x] It is missing to change the delay function.
   
   - [x] It is missing to improve the calibration routine 32K xtal oscilattor
   
   ## Impact
   
   Most power management system and subsystems that use RTC Low­Power Clocks.
   
   ## Testing
   
   Two tests were performed here:
   - I ran `pmconfig` with  `esp32-devkitc:pm` defconfig.
   - I used a LA to analyse average frequency of RTC clocks. 
   
   


-- 
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] saramonteiro commented on a change in pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

Posted by GitBox <gi...@apache.org>.
saramonteiro commented on a change in pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001#discussion_r661702920



##########
File path: arch/xtensa/src/esp32/Kconfig
##########
@@ -211,6 +211,40 @@ config ESP32_XTAL_26MHz
 
 endchoice # On-board Crystal Frequency
 
+choice ESP32_RTC_CLK_SRC
+    prompt "RTC clock source"
+    default ESP32_RTC_CLK_SRC_INT_RC
+    help

Review comment:
       done




-- 
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] saramonteiro commented on a change in pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

Posted by GitBox <gi...@apache.org>.
saramonteiro commented on a change in pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001#discussion_r661702846



##########
File path: arch/xtensa/src/esp32/Kconfig
##########
@@ -211,6 +211,40 @@ config ESP32_XTAL_26MHz
 
 endchoice # On-board Crystal Frequency
 
+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:
       done




-- 
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] xiaoxiang781216 merged pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001


   


-- 
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] gustavonihei commented on a change in pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001#discussion_r661653561



##########
File path: arch/xtensa/src/esp32/Kconfig
##########
@@ -211,6 +211,40 @@ config ESP32_XTAL_26MHz
 
 endchoice # On-board Crystal Frequency
 
+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:
       nit: A blank line is usually added between the configs




-- 
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] gustavonihei commented on a change in pull request #4001: xtensa/esp32: Support to select different clock source for RTC controller and close TODOs.

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #4001:
URL: https://github.com/apache/incubator-nuttx/pull/4001#discussion_r661653078



##########
File path: arch/xtensa/src/esp32/Kconfig
##########
@@ -211,6 +211,40 @@ config ESP32_XTAL_26MHz
 
 endchoice # On-board Crystal Frequency
 
+choice ESP32_RTC_CLK_SRC
+    prompt "RTC clock source"
+    default ESP32_RTC_CLK_SRC_INT_RC
+    help

Review comment:
       ```suggestion
       ---help---
   ```
   nit: minor styling issue




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