summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-06-11 10:47:51 +1000
committerDamien George <damien@micropython.org>2021-06-30 13:24:40 +1000
commit87985fc7e98454f16e8e054d846fa871688a2ef5 (patch)
tree5d583b7c07c57b4464fd3f1ab1052a451ca52839
parent4ada56d4cb4c518d2a78f7d7a600a4537188310a (diff)
stm32/boardctrl: Skip running main.py if boot.py had an error.
Previous behaviour was: if boot.py had an exception then main.py would still run, which is arguably unexpected behaviour. This commit changes the behaviour so main.py is not run if boot.py has an error. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/stm32/boardctrl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ports/stm32/boardctrl.c b/ports/stm32/boardctrl.c
index f1b7a4e81..fa71d8e7f 100644
--- a/ports/stm32/boardctrl.c
+++ b/ports/stm32/boardctrl.c
@@ -155,6 +155,8 @@ int boardctrl_run_boot_py(boardctrl_state_t *state) {
return BOARDCTRL_GOTO_SOFT_RESET_EXIT;
}
if (!ret) {
+ // There was an error, prevent main.py from running and flash LEDs.
+ state->reset_mode = BOARDCTRL_RESET_MODE_SAFE_MODE;
flash_error(4);
}
}