Micropython-main-boot: Difference between revisions
Jump to navigation
Jump to search
| Line 3: | Line 3: | ||
[[file:micropython-startup.png]] | [[file:micropython-startup.png]] | ||
== Virtual Machine Initialization == | |||
== boot.py script == | == boot.py script == | ||
| Line 12: | Line 14: | ||
The role of the {{fname|boot.py}} script is to perform a quick hardware initialization at startup. | The role of the {{fname|boot.py}} script is to perform a quick hardware initialization at startup. | ||
{{rbox-orange|The {{fname|boot.py}} script should be short and executes its content as fast as possible. | It is also a good place to mount additionnal file systems. | ||
{{rbox-orange|The {{fname|boot.py}} script should be short and executes its content as fast as possible. | |||
The MicroPython virtual machine will stays locked as long as the {{fname|boot.py}} have not terminated its processing. | The MicroPython virtual machine will stays locked as long as the {{fname|boot.py}} have not terminated its processing.}} | ||
Interacting with MicroPython is almost impossible during the processing of {{fname|boot.py}} . | {{underline|Remarks:}} | ||
* Interacting with MicroPython is almost impossible during the processing of {{fname|boot.py}} . | |||
* When using tools like Thonny, MPRemote, etc then boot.py execution time will be added to each connection attempt. | |||
== main.py script == | == main.py script == | ||
Revision as of 14:59, 28 April 2026
Startup Sequence
When powered up, the PymateIO initialize the MicrPython virtual machine which executes the following steps.
Virtual Machine Initialization
boot.py script
Loading the boot.py is the first operation performed by the virtual machine.
The virtual machine jump to the next step if the file is not available.
The role of the boot.py script is to perform a quick hardware initialization at startup.
It is also a good place to mount additionnal file systems.
The boot.py script should be short and executes its content as fast as possible.
The MicroPython virtual machine will stays locked as long as the boot.py have not terminated its processing.
Remarks:
- Interacting with MicroPython is almost impossible during the processing of boot.py .
- When using tools like Thonny, MPRemote, etc then boot.py execution time will be added to each connection attempt.
main.py script
The main.py script is the file containing the user program to execute at startup.
If the file is missing or script produce an error then the virtual machine jump to the next step (interactive REPL session).
REPL session
xxx
