Skip to content

Commit 80d81c6

Browse files
author
Zim Kalinowski
committed
Merge branch 'bugfix/ulp_riscv_i2c_example_crashes_on_s2_v4.4' into 'release/v4.4'
ulp-riscv: ULP RISC-V I2C example gets stuck on esp32s2 (v4.4) See merge request espressif/esp-idf!21861
2 parents 3cf24d8 + 96b152a commit 80d81c6

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

components/ulp/ulp_riscv.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ esp_err_t ulp_riscv_run(void)
3232
#if CONFIG_IDF_TARGET_ESP32S2
3333
/* Reset COCPU when power on. */
3434
SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
35-
esp_rom_delay_us(20);
36-
CLEAR_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
3735

3836
/* The coprocessor cpu trap signal doesnt have a stable reset value,
3937
force ULP-RISC-V clock on to stop RTC_COCPU_TRAP_TRIG_EN from waking the CPU*/
@@ -57,8 +55,6 @@ esp_err_t ulp_riscv_run(void)
5755
#elif CONFIG_IDF_TARGET_ESP32S3
5856
/* Reset COCPU when power on. */
5957
SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
60-
esp_rom_delay_us(20);
61-
CLEAR_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
6258

6359
/* The coprocessor cpu trap signal doesnt have a stable reset value,
6460
force ULP-RISC-V clock on to stop RTC_COCPU_TRAP_TRIG_EN from waking the CPU*/

components/ulp/ulp_riscv/ulp_riscv_utils.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,8 @@ void ulp_riscv_shutdown(void)
3131
/* Setting the delay time after RISCV recv `DONE` signal, Ensure that action `RESET` can be executed in time. */
3232
REG_SET_FIELD(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_2_CLK_DIS, 0x3F);
3333

34-
/* suspends the ulp operation*/
35-
SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_DONE);
36-
37-
/* Resets the processor */
38-
SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_SHUT_RESET_EN);
34+
/* Suspends the ulp operation and reset the ULP core. Must be the final operation before going to halt. */
35+
SET_PERI_REG_MASK(RTC_CNTL_COCPU_CTRL_REG, RTC_CNTL_COCPU_DONE | RTC_CNTL_COCPU_SHUT_RESET_EN);
3936

4037
while(1);
4138
}

0 commit comments

Comments
 (0)