File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -473,9 +473,6 @@ STATIC bool __attribute__((noinline)) run_code_py(safe_mode_t safe_mode, bool *s
473
473
usb_setup_with_vm ();
474
474
#endif
475
475
476
- // Make sure we are in the root directory before looking at files.
477
- common_hal_os_chdir ("/" );
478
-
479
476
// Check if a different run file has been allocated
480
477
if (next_code_configuration != NULL ) {
481
478
next_code_configuration -> options &= ~SUPERVISOR_NEXT_CODE_OPT_NEWLY_SET ;
@@ -1112,6 +1109,10 @@ int __attribute__((used)) main(void) {
1112
1109
serial_write_compressed (MP_ERROR_TEXT ("soft reboot\n" ));
1113
1110
}
1114
1111
simulate_reset = false;
1112
+
1113
+ // Always return to root before trying to run files.
1114
+ common_hal_os_chdir ("/" );
1115
+
1115
1116
if (pyexec_mode_kind == PYEXEC_MODE_FRIENDLY_REPL ) {
1116
1117
// If code.py did a fake deep sleep, pretend that we
1117
1118
// are running code.py for the first time after a hard
You can’t perform that action at this time.
0 commit comments