Commit 6e87aeb8 authored by Damien George's avatar Damien George Committed by Paul Sokolovsky

esp8266: Implement multistage bootstrap sequence.

Upon start-up, _boot module is executed from frozen files to do early
initialization, e.g. create and mount the flash filesystem. Then
"boot.py" is executed if it exists in the filesystem. Finally, "main.py"
is executed if exists to allow start-on-boot user applications.

This allows a user to make a custom boot file or startup application
without recompiling the firmware, while letting to do early initialization
in Python code.

Based on RFC https://github.com/micropython/micropython/issues/1955.
parent b69f798c
......@@ -54,7 +54,9 @@ STATIC void mp_reset(void) {
MP_STATE_PORT(mp_kbd_exception) = mp_obj_new_exception(&mp_type_KeyboardInterrupt);
MP_STATE_PORT(term_obj) = MP_OBJ_NULL;
#if MICROPY_MODULE_FROZEN
pyexec_frozen_module("boot");
pyexec_frozen_module("_boot");
pyexec_file("boot.py");
pyexec_file("main.py");
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment