Skip to content

Commit

Permalink
Merge branch 'bugfix/rtc_i2c_stuck_after_esp_restart' into 'master'
Browse files Browse the repository at this point in the history
ulp risc-v rtc i2c: Fix a bug where RTC I2C failed to initialize after esp_restart()

Closes IDFGH-9065

See merge request espressif/esp-idf!21862
  • Loading branch information
sudeep-mohanty committed Jan 5, 2023
2 parents 2df00a4 + 4a41039 commit 28ccb3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/ulp/ulp_riscv/ulp_riscv_i2c.c
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -398,6 +398,10 @@ void ulp_riscv_i2c_master_write_to_device(uint8_t *data_wr, size_t size)

esp_err_t ulp_riscv_i2c_master_init(const ulp_riscv_i2c_cfg_t *cfg)
{
/* Clear any stale config registers */
WRITE_PERI_REG(RTC_I2C_CTRL_REG, 0);
WRITE_PERI_REG(SENS_SAR_I2C_CTRL_REG, 0);

/* Reset RTC I2C */
#if CONFIG_IDF_TARGET_ESP32S2
i2c_dev->ctrl.i2c_reset = 1;
Expand Down

0 comments on commit 28ccb3b

Please sign in to comment.