Commit Graph

25 Commits

Author SHA1 Message Date
Michael (XIAO Xufeng)
af61c51385 Merge branch 'test/rtc_8m_d256_v4.3' into 'release/v4.3'
rtc: fixed 8MD256 can't be used as RTC slow src on ESP32 (v4.3)

See merge request espressif/esp-idf!18106
2022-11-12 00:45:11 +08:00
Michael (XIAO Xufeng)
7931c033ed pm: fixed RTC8M domain power issues
introduced in e44ead5356

1. The int8M power domain config by default is PD. While LEDC is using
RTC8M as clock source, this power domain will be kept on.

But when 8MD256 is used as RTC clock source, the power domain should
also be kept on.

On ESP32, there was protection for it, but broken by commit
e44ead5356. Currently the power domain
will be forced on when LEDC is using RTC8M as clock source &&
!int8m_pd_en (user enable ESP_PDP_DOMAIN_RTC8M in lightsleep). Otherwise
the power domain will be powered off, regardless of RTC clock source.

In other words, int8M domain will be forced off (even when 8MD256
used as RTC clock source) if LEDC not using RTC8M as clock source, user
doesn't enable ESP_PDP_DOMAIN_RTC8M, or in deep sleep.

On later chips, there's no such protection, so 8MD256 could't be used as
RTC clock source in sleep modes.

This commit adds protection of 8MD256 clock to other chips. Fixes the
incorrect protection logic overriding on ESP32. Now the power domain
will be determiend by the logic below (order by priority):

    1. When RTC clock source uses 8MD256, power up
    2. When LEDC uses RTC8M clock source, power up
    3. In deepsleep, power down
    4. Otherwise determined by user config of ESP_PDP_DOMAIN_RTC8M,
       power down by default. (This is preferred to have highest
       priority, but it's kept as is because of current code structure.)

2. Before, after the macro `RTC_SLEEP_CONFIG_DEFAULT` decides dbias, the
protection above may force the int8m PU. This may cause the inconsistent
of dbias and the int8m PU status.

This commit lifts the logic of pd int8m/xtal fpu logic to upper layer
(sleep_modes.c).

Related: https://github.com/espressif/esp-idf/issues/8007, https://github.com/espressif/esp-idf/pull/8089

temp
2022-11-05 20:02:53 +08:00
Michael (XIAO Xufeng)
b56b459960 rtc: fixed 8MD256 can't be used as RTC slow src on ESP32
Sync configuration from other chips

Closes: https://github.com/espressif/esp-idf/issues/8007, https://github.com/espressif/esp-idf/pull/8089
2022-11-04 12:37:45 +08:00
Song Ruo Jing
c0be4cb2ba rtc_clk: Fix rtc8m calibration failure after cpu/core reset
Explicitly guarantee 8md256 clk is enabled before calibration
2022-10-12 12:41:50 +08:00
jingli
07d69b7cae esp_hw_support/clk_cali: fix xtal32k error detect 2022-09-21 16:29:36 +08:00
morris
d04a94320a Merge branch 'bugfix/fix_adc_calibration_light_sleep_issue_v4.3' into 'release/v4.3'
adc: fix calibration error when waking up from light sleep (v4.3)

See merge request espressif/esp-idf!16929
2022-04-21 15:56:10 +08:00
Michael (XIAO Xufeng)
75c720bcd3 esp_phy: use spinlock to avoid regi2c access conflicts 2022-04-06 14:46:10 +08:00
Armando
fe5a5284ba sleep: restore analog calibration registers after waking up from light sleep
Closes https://github.com/espressif/esp-idf/issues/8287
Closes https://github.com/espressif/esp-idf/issues/7921
2022-03-07 21:58:42 +08:00
jingli
4b73610eea reduce bootup time when using usb-serial-jtag 2021-12-03 20:55:52 +08:00
wuzhenghui
7c52647243 fix stuck in rtc_clk_cal 2021-10-21 21:54:04 +08:00
Omar Chebib
173e001680 regi2c: add a spinlock for accessing (reg)I2C devices
When not compiling bootloader, a spinlock will be used for reading or writing
I2C internal devices/registers.
When compiling for bootloader, no need to use any lock.
2021-09-10 18:50:16 +08:00
David Cermak
e7500c711d rtc: Fix minor const char* correction issue 2021-08-18 19:29:44 +08:00
Li Shuai
21b3068b77 deep sleep: clear wakeup and reject int raw signal before entry sleep 2021-06-17 10:41:22 +08:00
Renz Bagaporo
0e904b3f7e ulp: clear rtc int at initialization
Closes https://github.com/espressif/esp-idf/issues/6654
2021-06-01 21:41:12 +08:00
Li Shuai
f684bd10f5 deep sleep: optimize sleep current in wifi softap mode 2021-04-29 10:14:30 +08:00
chaijie
e8282fb5c5 esp32s2/esp32s3/esp32c3: Decrease boot up time by delete useless slow clock calibration 2021-04-21 11:38:26 +00:00
Renz Bagaporo
d1c800fbbb components: fix ldgen check errors 2021-01-19 11:17:18 +08:00
Angus Gratton
f683db7aea Merge branch 'feature/c3_IDF-2554' into 'master'
global: Uses CCOUNT API instead of XTHAL macro

Closes IDF-2554

See merge request espressif/esp-idf!11954
2021-01-13 12:55:21 +08:00
KonstantinKondrashov
dada7cd035 global: Uses CCOUNT API instead of XTHAL macro 2021-01-12 16:24:23 +08:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
ninh
dc7bdb9857 adjust lightsleep overhead time and cali slowclk 2021-01-06 03:40:28 +00:00
Cao Sen Miao
e338a2e3df rtc: add function to en/disable the rtc clock 2020-12-23 09:53:24 +11:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
fuzhibo
93c7cf094e rtc: update rtc related code(rtc_sleep rtc_init) to support esp32s3 2020-11-04 02:43:41 +00:00
Renz Bagaporo
6b0a5af73e soc: move implementations to esp_hw_support 2020-10-28 22:38:50 +08:00