diff --git a/src/omv/main.c b/src/omv/main.c index b40413be6..b186a1527 100644 --- a/src/omv/main.c +++ b/src/omv/main.c @@ -378,6 +378,9 @@ soft_reset: __fatal_error(buf); } + // Re-enable FS IRQ (disabled in usbdbg) + HAL_NVIC_EnableIRQ(OTG_FS_IRQn); + // Run self tests the first time only f_res = f_stat("selftest.py", NULL); if (first_soft_reset && f_res == FR_OK) { @@ -413,6 +416,9 @@ soft_reset: nlr_pop(); }// if this gets interrupted again ignore it. } + + // Re-enable FS IRQ (disabled in usbdbg) + HAL_NVIC_EnableIRQ(OTG_FS_IRQn); } // If there's no script ready, just re-exec REPL @@ -427,6 +433,9 @@ soft_reset: nlr_pop(); } + + // Re-enable FS IRQ (disabled in usbdbg) + HAL_NVIC_EnableIRQ(OTG_FS_IRQn); } if (usbdbg_script_ready()) { @@ -441,7 +450,8 @@ soft_reset: } } - // Disable all IRQs except Systick and Flash IRQs + // Disable all other IRQs except Systick and Flash IRQs + // Note: FS IRQ is disable, since we're going for a soft-reset. irq_set_base_priority(2); // soft reset diff --git a/src/omv/usbdbg.c b/src/omv/usbdbg.c index 124fd0fbe..75ee15b2a 100644 --- a/src/omv/usbdbg.c +++ b/src/omv/usbdbg.c @@ -238,6 +238,9 @@ void usbdbg_control(void *buffer, uint8_t request, uint32_t length) // Disable IDE IRQ (re-enabled by pyexec or main). usbdbg_set_irq_enabled(false); + // We can safely disable FS IRQ here + HAL_NVIC_DisableIRQ(OTG_FS_IRQn); __DSB(); __ISB(); + // interrupt running code by raising an exception mp_obj_exception_clear_traceback(mp_const_ide_interrupt); pendsv_nlr_jump_hard(mp_const_ide_interrupt);