Commit Graph

301 Commits

Author SHA1 Message Date
Jiang Jiang Jian
b13ddef25c Merge branch 'bugfix/close_phy_tsens_before_sleep_v4.3' into 'release/v4.3'
sleep: fix deepsleep current leakage caused by phy_tsens (backport v4.3)

See merge request espressif/esp-idf!23907
2023-06-06 11:52:12 +08:00
wuzhenghui
327352cf53 bugfix: fix wakeup failed if powerdown flash in lightsleep 2023-05-31 19:11:23 +08:00
wuzhenghui
2f74124170 bugfix: close phy_tsens before deepsleep 2023-05-25 11:53:32 +08:00
wuzhenghui
ad27bd8aa0 deep sleep: close rf to optimize sleep current 2023-03-30 03:15:45 +00:00
KonstantinKondrashov
e88f235326 all: Apply new version logic (major * 100 + minor) 2023-03-02 03:21:34 +00:00
Jiang Jiang Jian
043958e39f Merge branch 'bugfix/fix_gpio_wakeup_related_issues_in_ssc_sleep_test_backport_v4.3' into 'release/v4.3'
sleep: fix gpio wakeup related issues(backport v4.3)

See merge request espressif/esp-idf!22334
2023-02-26 15:51:29 +08:00
jingli
805db259b7 sleep: fix gpio wakeup not working properly in some cases
Before this fix, when we call esp_pm_configure after gpio_wakeup_enable,
the configuration of GPIO in sleep state in gpio_wakeup_enable will be
overwritten by esp_pm_configure.
2023-02-13 19:54:17 +08:00
jingli
f556ac1b92 soc_caps: remove SOC_GPIO_SUPPORT_SLP_SWITCH
all esp chips support this feature
2023-02-13 19:54:11 +08:00
KonstantinKondrashov
3dcdcc08eb efuse: Adds major and minor versions and others 2023-02-11 08:06:49 +00:00
jiangguangming
5888f9201f esp_system: use ESP_CONSOLE_UART_NUM instead of CONSOLE_UART_NUM 2022-11-28 10:37:39 +08:00
jingli
24eea75f9c esp_hw_support/sleep: fix current leakage when hold digital io during deep sleep 2022-11-18 03:00:01 +00:00
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
jingli
81b98881ac esp_hw_support/sleep: fix cannot pd cpu and rc fast at the same time during light sleep
Since cpu retention dma use rc fast as clk source, so rc_fast_digi
will be enabled when we config to pd cpu. And cpu retention does not
need rc fast keep on during light sleep. So, if we use rc_fast_digi
to determine whether rc fast can be powered down, then cpu and and
rc fast cannot pd at the same time.
2022-11-06 01:34:18 +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)
696de2e7ac pm: add test for RTC using 8MD256 as clock source 2022-11-04 12:37:45 +08:00
jingli
d8141bdf51 esp_hw_support/sleep: fix light sleep wakeup flag
light sleep wakeup flag is true to indicate the most recent successful wakeup from light sleep,
which means the most recent light sleep occurred successfully and then wakes up by wakeup source
2022-10-26 17:07:07 +08:00
jingli
b6491464e1 esp32/rtc: fix xtal unstable in some cases when sleep
1. add xtal buf wait to fix high temperature restart issue
2. add min sleep value to fix xtal stop due to too short sleep time issue
2022-10-26 17:05:07 +08:00
Michael (XIAO Xufeng)
e28bb4b9c4 usb_serial_jtag: fixed the docs that we can use usj in sleep modes
Related to: https://github.com/espressif/esp-idf/issues/8507, https://github.com/espressif/esp-idf/issues/8884
2022-09-22 17:39:15 +08:00
jingli
b85e5627d3 esp_hw_support/clk_cali: remove redundant check for cali value 2022-09-21 16:30:17 +08:00
Jiang Jiang Jian
2828e8fe2f Merge branch 'bugfix/wifi_bt_mac_bb_pd_light_sleep_v4.3' into 'release/v4.3'
backport v4.3: deep sleep does not need cpu and wifi/bt mac retention

See merge request espressif/esp-idf!19511
2022-08-16 17:09:25 +08:00
xiongweichao
cfc5576b0d Power Management: fix the issue of sleeping time error beacause external 32kHz xtal does not exist 2022-08-11 20:17:39 +08:00
Li Shuai
0d7b72e057 sleep: deep sleep does not need cpu and wifi/bt mac retention 2022-08-11 16:36:57 +08:00
wangmengyang
580b57c8b1 component/bt: reset Bluetooth hardware during controller inititalization on ESP32-C3
1. Rename MACROs SYSTEM_WIFI_RST_EN register bit fields to be more recognizable
2. reset Bluetooth baseband and MAC bits to fix the issue of task watchdog triggered during controller initialization due to invalid hardware state
2022-07-13 17:35:22 +08:00
Ivan Grokhotkov
95dbc746ed esp_system: fix garbled UART output on startup on esp32s2
Closes https://github.com/espressif/esp-idf/issues/9168
2022-07-11 02:41:46 +00:00
KonstantinKondrashov
714bc66e0e efuse: Checks errors of 4x coding scheme for BLOCK0 if so then abort 2022-06-22 18:04:11 +08:00
KonstantinKondrashov
0a71dce1ef reset_reasons: EFUSE_RST is treated as POWERON_RST
ESP32 does not have the EFUSE_RST, the rest chips has this reset reason.
2022-06-22 17:56:32 +08:00
KonstantinKondrashov
50606887b2 esp_hw_support: Fix time spent in light sleep when RTC is used for gettimeofday
The esp_timer was not advanced correctly.
2022-06-09 14:51:44 +00:00
jingli
8309e3e5ce esp_hw_‎support/sleep: ‎fix cannot lightsleep again after a wakeup from ULP
Since ulp wakeup signal are connected to ulp int raw(except esp32), we
need to clear ulp int raw before sleep when ulp wakeup enabled. Otherwise,
if the ulp int raw is already set, chip will not sleep properly.

Closes https://github.com/espressif/esp-idf/issues/6229
2022-05-19 23:54:29 +08:00
Jiang Jiang Jian
f60bbf5172 Merge branch 'feature/esp32c3_apptrace_v4.3' into 'release/v4.3'
apptrace: refactoring & esp32c3 support (v4.3)

See merge request espressif/esp-idf!17878
2022-05-18 02:09:44 +08:00
Alexey Gerenkov
d06fac5c8b apptrace: Adds ESP32-C3 support 2022-05-13 16:23:46 +03:00
Michael (XIAO Xufeng)
58f378602f Merge branch 'feature/usb_serial_default_option_v4.3' into 'release/v4.3'
vfs_usb_serial: set secondary selection for making usb port can output under default menu (backport v4.3)

See merge request espressif/esp-idf!18062
2022-05-13 17:24:33 +08:00
Alexey Gerenkov
fa6655cbcf apptrace: Refactors apptrace for better support various tracing HW 2022-05-13 08:45:31 +00:00
Cao Sen Miao
0f2aa2eae4 vfs_usb_serial: set secondary selection for making usb port can output under default menu 2022-05-12 12:23:35 +08:00
jingli
92ccc5fa95 fix _rtc_slow_length being incorrectly optimized by compiler 2022-05-01 23:22:05 +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
Michael (XIAO Xufeng)
f8e45766b5 sleep: fixed ext1 cannot wakeup via RTCIO >= 18 issue 2022-02-18 11:10:49 +08:00
Cao Sen Miao
9c4b96d63b USB_SERIAL_JTAG: Fix the issue that there is no rom log when restarting 2022-02-10 10:33:40 +08:00
Michael (XIAO Xufeng)
ab5c956bdf Merge branch 'bugfix/esp_timer_before_init_v4.3' into 'release/v4.3'
esp_timer: allow querying the timer before esp_timer_init is called (backport v4.3)

See merge request espressif/esp-idf!15772
2021-11-24 16:44:56 +00:00
Omar Chebib
e615a9546b Sleep: fix wrong debug level
Fix usage of ESP_LOGD in sleep_modes.c which triggers a panic when
used in debug log level.

* Closes https://github.com/espressif/esp-idf/issues/7942
2021-11-22 16:42:48 +08:00
Ivan Grokhotkov
b5fe84a250 esp_timer: allow querying the timer before esp_timer_init is called 2021-11-02 17:33:07 +08:00
Konstantin Kondrashov
8140b10a16 esp_system: Adds sync of FRC & RTC counters in esp_restart (v4.3) 2021-10-28 17:33:46 +00:00
Konstantin Kondrashov
fa85714845 Systimer reset alternative on S2 (and others) (v4.3) 2021-10-28 08:00:28 +00:00
Mahavir Jain
28f8ac5f12 cpu_start: rename function to add core prefix for more clarity 2021-10-21 08:09:14 +05:30
Mahavir Jain
76e606ab32 cpu_start: let individual core clear its interrupt matrix
There was race condition where interrupt entries set by APP cpu core
could have been cleared during PRO cpu startup.

This was causing "cache access error" not being detected for ESP32 APP
CPU core.

This fix allows to NOT modify or clear any entries set by other core
(APP or PRO) and thus avoiding any race conditions during startup code.
2021-10-21 08:03:55 +05:30
morris
eef5add97e Merge branch 'bugfix/fix_esp32s2_deep_sleep_timer_wake_up_fail_backport_v4.3' into 'release/v4.3'
rtc: fix esp32s2 fall into sleep forever when deep-sleep time is set to 0(backport v4.3)

See merge request espressif/esp-idf!13560
2021-10-19 04:44:47 +00:00
Cao Sen Miao
ce9e615679 Merge branch 'feature/esp32c3_usbjtagserial_v4.3' into 'release/v4.3'
usb_serial_jtag: support usb_serial_jtag on esp32c3(backport v4.3)

See merge request espressif/esp-idf!15319
2021-10-14 10:38:02 +00:00
Song Ruo Jing
75916a8758 Merge branch 'bugfix/cpu_reset_perip_clk_disable_v4.3' into 'release/v4.3'
esp_system: Peripheral clocks faulty become disabled during cpu reset

See merge request espressif/esp-idf!15482
2021-10-13 10:04:13 +00:00
songruojing
023bbe5cb1 esp_system: fix the bug that some peripheral clocks are being disabled during cpu reset for esp32s2, c3, s3 2021-10-12 11:37:17 +08:00
Jeroen Domburg
d6cdb3e0ae usb_serial_jtag: support usb_serial_jtag on esp32c3
USB serial/jtag controller: Add vfs (logging/printf), panic handler, gdb support.

See merge request espressif/esp-idf!12925
2021-10-11 17:34:24 +08:00
Cao Sen Miao
ea06ee1ad6 spi_flash: move the unlock patch to bootloader and add support for GD 2021-10-11 10:52:52 +08:00