mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 14:44:32 +02:00
replacing reset by register operations with ROM interfaces to decouple the effects of register name changes
This commit is contained in:
@@ -864,7 +864,7 @@ void bootloader_reset(void)
|
|||||||
#ifdef BOOTLOADER_BUILD
|
#ifdef BOOTLOADER_BUILD
|
||||||
bootloader_atexit();
|
bootloader_atexit();
|
||||||
esp_rom_delay_us(1000); /* Allow last byte to leave FIFO */
|
esp_rom_delay_us(1000); /* Allow last byte to leave FIFO */
|
||||||
REG_WRITE(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST);
|
esp_rom_software_reset_system();
|
||||||
while (1) { } /* This line will never be reached, used to keep gcc happy */
|
while (1) { } /* This line will never be reached, used to keep gcc happy */
|
||||||
#else
|
#else
|
||||||
abort(); /* This function should really not be called from application code */
|
abort(); /* This function should really not be called from application code */
|
||||||
|
@@ -4,7 +4,6 @@
|
|||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "soc/rtc_cntl_reg.h"
|
|
||||||
#include "esp_rom_sys.h"
|
#include "esp_rom_sys.h"
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
@@ -71,7 +70,7 @@ extern "C" {
|
|||||||
#ifndef ESP_FAULT_ASSERT_DEBUG
|
#ifndef ESP_FAULT_ASSERT_DEBUG
|
||||||
|
|
||||||
#define _ESP_FAULT_RESET() do { \
|
#define _ESP_FAULT_RESET() do { \
|
||||||
REG_WRITE(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST); \
|
esp_rom_software_reset_system(); \
|
||||||
_ESP_FAULT_ILLEGAL_INSTRUCTION; \
|
_ESP_FAULT_ILLEGAL_INSTRUCTION; \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
#include "soc/rtc_cntl_reg.h"
|
#include "soc/rtc_cntl_reg.h"
|
||||||
#include "esp_private/panic_internal.h"
|
#include "esp_private/panic_internal.h"
|
||||||
#include "esp_rom_uart.h"
|
#include "esp_rom_uart.h"
|
||||||
|
#include "esp_rom_sys.h"
|
||||||
#if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
|
#if CONFIG_ESP_SYSTEM_MEMPROT_FEATURE
|
||||||
#if CONFIG_IDF_TARGET_ESP32S2
|
#if CONFIG_IDF_TARGET_ESP32S2
|
||||||
#include "esp32s2/memprot.h"
|
#include "esp32s2/memprot.h"
|
||||||
@@ -42,7 +43,7 @@ void IRAM_ATTR esp_restart_noos_dig(void)
|
|||||||
esp_cpu_unstall(PRO_CPU_NUM);
|
esp_cpu_unstall(PRO_CPU_NUM);
|
||||||
#endif
|
#endif
|
||||||
// reset the digital part
|
// reset the digital part
|
||||||
SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_SYS_RST);
|
esp_rom_software_reset_system();
|
||||||
while (true) {
|
while (true) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user