diff --git a/stmhal/main.c b/stmhal/main.c
index 2eb5a5338563f495d4b81340f14091df85e41fd5..733d3a19b4377525c241f77421a2233133931258 100644
--- a/stmhal/main.c
+++ b/stmhal/main.c
@@ -529,7 +529,7 @@ soft_reset:
 
     // run boot.py, if it exists
     // TODO perhaps have pyb.reboot([bootpy]) function to soft-reboot and execute custom boot.py
-    if (reset_mode == 1) {
+    if (reset_mode == 1 || reset_mode == 3) {
         const char *boot_py = "boot.py";
         FRESULT res = f_stat(boot_py, NULL);
         if (res == FR_OK) {
@@ -585,7 +585,7 @@ soft_reset:
     // At this point everything is fully configured and initialised.
 
     // Run the main script from the current directory.
-    if (reset_mode == 1 && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
+    if ((reset_mode == 1 || reset_mode == 3) && pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL) {
         const char *main_py;
         if (MP_STATE_PORT(pyb_config_main) == MP_OBJ_NULL) {
             main_py = "main.py";