From 4eabff53cb390f555758ac9c326f75e900dc5a11 Mon Sep 17 00:00:00 2001 From: robert-hh Date: Wed, 16 Jun 2021 09:06:05 +0200 Subject: [PATCH] mimxrt/main: Skip running main.py if boot.py failed. See related #7379. --- ports/mimxrt/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/mimxrt/main.c b/ports/mimxrt/main.c index bd1c3e8884..d605c91555 100644 --- a/ports/mimxrt/main.c +++ b/ports/mimxrt/main.c @@ -70,7 +70,8 @@ int main(void) { if (ret & PYEXEC_FORCED_EXIT) { goto soft_reset_exit; } - if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) { + // Do not execute main.py if boot.py failed + if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL && ret != 0) { ret = pyexec_file_if_exists("main.py"); if (ret & PYEXEC_FORCED_EXIT) { goto soft_reset_exit;