xtensa/esp32: Fix RTC WDT deinitialization on start routine #3975
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR intends to fix the RTC WDT deinitialization on the NuttX startup.
Write protection must be disabled before performing changes to the WDT registers. Furthermore, the routine was resetting the wrong field from the RTC WDT register.
The
RTC_CNTL_WDT_FLASHBOOT_MOD_EN
field relates to Flash Boot Protection and it is enabled by the 1st stage bootloader. The 2nd stage bootloader takes care of disabling it.Then the 2nd stage bootloader enables the RTC WDT for checking the startup sequence of the application image.
Impact
Now it is now possible to once again enable the RTC WDT on the ESP32 2nd stage bootloader.
Testing
Tested
esp32-wrover-kit:nsh
with ESP-IDF vanilla 2nd stage bootloader.