From e83aa252f7c58db3d1a95b399c1bcdf791dcf819 Mon Sep 17 00:00:00 2001 From: Peter Boin Date: Wed, 8 Sep 2021 15:45:03 +1000 Subject: [PATCH] stm32/main: Run optional frozen module at boot. If a board specifies a filename via MICROPY_BOARD_FROZEN_BOOT_FILE then that will be run on start up, before the usual boot.py. --- ports/stm32/main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/stm32/main.c b/ports/stm32/main.c index 5d1ff2dcf5..974602cb05 100644 --- a/ports/stm32/main.c +++ b/ports/stm32/main.c @@ -564,6 +564,11 @@ soft_reset: // reset config variables; they should be set by boot.py MP_STATE_PORT(pyb_config_main) = MP_OBJ_NULL; + // Run optional frozen boot code. + #ifdef MICROPY_BOARD_FROZEN_BOOT_FILE + pyexec_frozen_module(MICROPY_BOARD_FROZEN_BOOT_FILE); + #endif + // Run boot.py (or whatever else a board configures at this stage). if (MICROPY_BOARD_RUN_BOOT_PY(&state) == BOARDCTRL_GOTO_SOFT_RESET_EXIT) { goto soft_reset_exit;