summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobert-hh <robert@hammelrath.com>2021-06-16 09:06:05 +0200
committerDamien George <damien@micropython.org>2021-06-26 22:27:02 +1000
commit4eabff53cb390f555758ac9c326f75e900dc5a11 (patch)
treee8cda5f26bfaa2eb6daf0ec1c031df71ebe5d89f
parentb35566af799ccb76711d228f1314f7df53ee42bc (diff)
mimxrt/main: Skip running main.py if boot.py failed.
See related #7379.
-rw-r--r--ports/mimxrt/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/mimxrt/main.c b/ports/mimxrt/main.c
index bd1c3e888..d605c9155 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;