I have updated the ESP32 code so it reports the reset cause when starting up.
I've seen some spontaneous resets, and have the log results.
The "reset_cause()" function returns PWRON_RESET
The check of reset_state_reg = machine.mem32[0x3FF48034] returns 0x330C
According to the documentation:
Code: Select all
# RTC_CNTL_RESET_STATE_REG
# Register 31.12. RTC_CNTL_RESET_STATE_REG (0x3FF48034)
# RTC_CNTL_RESET_CAUSE_APPCPUReset cause for APP_CPU. (RO) bits 11-6
# RTC_CNTL_RESET_CAUSE_PROCPUReset cause for PRO_CPU. (RO) bits 5-0
#
#
# PRO APP Source Reset Type Note
# 0x01 0x01 Chip Power On Reset System Reset -
# 0x10 0x10 RWDT System Reset System Reset SeeWDT Chapter.
# 0x0F 0x0F Brown Out Reset System Reset SeePower Management Chapter.
# 0x03 0x03 Software System Reset Core Reset Configure RTC_CNTL_SW_SYS_RST register.
# 0x05 0x05 Deep Sleep Reset Core Reset SeePower Management Chapter.
# 0x07 0x07 MWDT0 Global Reset Core Reset SeeWDT Chapter.
# 0x08 0x08 MWDT1 Global Reset Core Reset SeeWDT Chapter.
# 0x09 0x09 RWDT Core Reset Core Reset SeeWDT Chapter.
# 0x0B - MWDT0 CPU Reset CPU Reset SeeWDT Chapter.
# 0x0C - Software CPU Reset CPU Reset Configure RTC_CNTL_SW_APPCPU_RST register.
# - 0x0B MWDT1 CPU Reset CPU Reset SeeWDT Chapter.
# - 0x0C Software CPU Reset CPU Reset Configure RTC_CNTL_SW_APPCPU_RST register.
# 0x0D 0x0D RWDT CPU Reset CPU Reset SeeWDT Chapter.
# - 0xE PRO CPU Reset CPU Reset Indicates that the PRO CPU has independently reset the APP CPU by configuring the DPORT_APPCPU_RESETTING register
the register value returned 0x330C which is 0011001100001100
Breaking into the bit groups
0011 APP and PRO_CPU state vector selection (?)
001100 APP_CPU 0x0C Software CPU Reset Configure RTC_CNTL_SW_APPCPU_RST register.
001100 PROC_CPU 0x0C Software CPU Reset Configure RTC_CNTL_SW_APPCPU_RST register.
That seems different than the value Python returns which is PWRON_RESET. That is not correct because the ESP-32 is not being powered down during these resets. The power supply is stable, regulated from 12V to 5V DC on the board holding the ESP32 module, with plenty of decoupling capacitors.
I search for "RTC_CNTL_SW_APPCPU_RS" in the
ESP32 reference manual, but don't find any details on what it means or how to set it.
I believe something in the software is causing the reset - how can I learn more about the source of the reset?