From 87985fc7e98454f16e8e054d846fa871688a2ef5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 11 Jun 2021 10:47:51 +1000 Subject: [PATCH] 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 --- ports/stm32/boardctrl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32/boardctrl.c b/ports/stm32/boardctrl.c index f1b7a4e81c..fa71d8e7f4 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); } }