Skip to content

Commit 38b5788

Browse files
committed
Disable interrupts around call to flash_do_cmd.
1 parent 2101084 commit 38b5788

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ports/raspberrypi/supervisor/internal_flash.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ void supervisor_flash_init(void) {
9191
// Read the RDID register to get the flash capacity.
9292
uint8_t cmd[] = {0x9f, 0, 0, 0};
9393
uint8_t data[4];
94+
common_hal_mcu_disable_interrupts();
9495
supervisor_flash_pre_write();
9596
flash_do_cmd(cmd, data, 4);
9697
supervisor_flash_post_write();
98+
common_hal_mcu_enable_interrupts();
9799
uint8_t power_of_two = FLASH_DEFAULT_POWER_OF_TWO;
98100
// Flash must be at least 2MB (1 << 21) because we use the first 1MB for the
99101
// CircuitPython core. We validate the range because Adesto Tech flash chips

0 commit comments

Comments
 (0)