Skip to content

Commit

Permalink
stm32/boardctrl: Skip running main.py if boot.py had an error.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dpgeorge committed Jun 30, 2021
1 parent 4ada56d commit 87985fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ports/stm32/boardctrl.c
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 87985fc

Please sign in to comment.