-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add esp32s2 safe mode support & fix user_safe_mode output #3395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! This essentially does match behavior of other ports already and this doesn't need to change.
We will need the soft reboot approach for other safe mode failures though.
Current Status:
What changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! I have some comments that probably stem from me suggesting incorrect code on Discord, I've tried to correct it and explain my logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes I requested!
Please go through issue #3389 for a background of this PR.
What works:
Note: If you do not have any way of guessing the loop status, power-on the board/press the reset button and after a short delay, press and hold boot button for a while
USER_SAFE_MODE
which provides a board specific reason for entering safe mode.To-do:
As of now when boot button is pressed esp32s2 doesn't perform a
soft_reboot
withsafe_mode
data stored in ram, instead it continues to boot withsafe_mode
status beingUSER_SAFE_MODE
and finally ends up in safe mode. This workflow is not consistent with other CPY ports where a reset is performed and safe mode is entered on next boot.To address this the following needs to be implemented:
USER_SAFE_MODE
in functionwait_for_safe_mode_reset()
,soft_reboot
needs to be called.port_set_saved_word()
function needs to edited in order to savesafe_mode
status in ram for the next boot.