diff --git a/ports/rp2/rp2_flash.c b/ports/rp2/rp2_flash.c index 45f2ec70e101..eae219f49ea9 100644 --- a/ports/rp2/rp2_flash.c +++ b/ports/rp2/rp2_flash.c @@ -139,10 +139,10 @@ static uint32_t begin_critical_flash_section(void) { } static void end_critical_flash_section(uint32_t state) { + rp2_flash_set_timing_internal(clock_get_hz(clk_sys)); #if defined(MICROPY_HW_PSRAM_CS_PIN) && MICROPY_HW_ENABLE_PSRAM psram_init(MICROPY_HW_PSRAM_CS_PIN); #endif - rp2_flash_set_timing_internal(clock_get_hz(clk_sys)); restore_interrupts(state); if (multicore_lockout_victim_is_initialized(1 - get_core_num())) { multicore_lockout_end_blocking();