machine.soft_reset() behaves curiously on esp8266
Hi!
This is related to https://github.com/micropython/micropython/issues/5764
Thanks a lot for implementing it by the way! 😄
If I invoke it from the REPL, everything works as expected, but if it's invoked from a running code, it will drop to REPL (and with no MPY: soft reboot message). Here's an example:
try:
trixie.run()
except KeyboardInterrupt:
trixie.runner.stop()
except trixie.ResetError:
# land here on reset
print('SOFT RESET')
machine.soft_reset()
except trixie.RebootError:
# land here on reboot
print('HARD RESET')
machine.reset()
except Exception as exc:
# we should never end up here
print('EXCEPTION')
trixie.runner.stop()
trixie.run() raises trixie.SoftReset on soft reset intent, after which 'SOFT RESET' is printed, but then it drops to REPL instead.
I saw it in another issue, that it's by design that main.py won't be called on soft-reset, so I tested the snippet above in _boot.py and boot.py also, but it produces the same behavior. Not having 'MPY: soft reset' printed is suspicious. I'm confused if this is indeed a bug, or I'm doing something wrong.
Thanks a lot for looking into this!
ESP32 related issue
I'm at a loss here, I can't seem to figure this out. I have this extremely odd issue where an LED controller I have will become laggy over the peirod of several days. This wouldn't be a problem if the issue didn't continue even after running machine.reset(). If I physically press the reset button on my esp32 (or unplug and replug) it fixes it. If anyone has any suggestions I'll be happy to hear them as I've been pondering this for months