Difference between esp_reset_reason() and rtc_get_reset_reason(int cpuNo)
Difference between esp_reset_reason() and rtc_get_reset_reason(int cpuNo)
What is the difference between esp_reset_reason() and rtc_get_reset_reason(int cpuNo) for ESP32 and respective descriptions of the return codes of each of the functions?
Re: Difference between esp_reset_reason() and rtc_get_reset_reason(int cpuNo)
esp_reset_reason is a public API provided in IDF, you can find the description here: https://docs.espressif.com/projects/esp ... set-reason
rtc_get_reset_reason is a lower level function implemented in the ROM code, which simply returns the reset reason value captured by the hardware. As such it can't distinguish between various causes of software reset (for example: esp_restart() being called or a CPU exception occurring). Return values of this function are chip-specific, the values can be found in rom/rtc.h header file.
In pretty much every case in an IDF application it is better to use esp_reset_reason().
rtc_get_reset_reason is a lower level function implemented in the ROM code, which simply returns the reset reason value captured by the hardware. As such it can't distinguish between various causes of software reset (for example: esp_restart() being called or a CPU exception occurring). Return values of this function are chip-specific, the values can be found in rom/rtc.h header file.
In pretty much every case in an IDF application it is better to use esp_reset_reason().
Who is online
Users browsing this forum: amiral, Baidu [Spider], Majestic-12 [Bot] and 82 guests