What does happen during a soft reset?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
fstengel
Posts: 55
Joined: Tue Apr 17, 2018 4:37 pm

What does happen during a soft reset?

Post by fstengel » Fri May 15, 2020 6:51 am

The title says it all: what exactly does happen during a soft reset? Looking through the documentation, I only found an explicit reference in the WiPy section:
A soft reset simply clears the state of the MicroPython virtual machine, but leaves hardware peripherals unaffected.
There are many mentions of hard/soft resets throughout the documentation (like paragraph 3.5 of the tutorial) but hardly ever a explanation of what happens.
To enhance my question:
  • Is the micropython virtual machine simply restarted? What is the process of that restart?
  • Is there some clean-up that happens before that restart? If there is, is there a way to hook into it?
  • Is the hardware state left as is or are there bits and bobs that are somehow reset to more or less startup values?
To put some context in my question, I am currently playing with littlevGL on my M5Stack and I noticed that when I do a soft reset, then I get a message telling me that the display driver is deinitializing:

Code: Select all

Deinitializing ILI9341..
MPY: soft reboot

Post Reply