From 38b5788bddbea00d8bc3f084463b5bf58bab2fff Mon Sep 17 00:00:00 2001 From: eightycc Date: Tue, 4 Mar 2025 19:27:26 -0800 Subject: [PATCH] Disable interrupts around call to flash_do_cmd. --- ports/raspberrypi/supervisor/internal_flash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/raspberrypi/supervisor/internal_flash.c b/ports/raspberrypi/supervisor/internal_flash.c index 563795c516a9b..91575a4ea6254 100644 --- a/ports/raspberrypi/supervisor/internal_flash.c +++ b/ports/raspberrypi/supervisor/internal_flash.c @@ -91,9 +91,11 @@ void supervisor_flash_init(void) { // Read the RDID register to get the flash capacity. uint8_t cmd[] = {0x9f, 0, 0, 0}; uint8_t data[4]; + common_hal_mcu_disable_interrupts(); supervisor_flash_pre_write(); flash_do_cmd(cmd, data, 4); supervisor_flash_post_write(); + common_hal_mcu_enable_interrupts(); uint8_t power_of_two = FLASH_DEFAULT_POWER_OF_TWO; // Flash must be at least 2MB (1 << 21) because we use the first 1MB for the // CircuitPython core. We validate the range because Adesto Tech flash chips