Sfoglia il codice sorgente

RP2040: Fix random boot hangs

Sometimes flash_do_cmd() call would coincide with SysTick interrupt.
Interrupts should be disabled when running it.
Petteri Aimonen 2 anni fa
parent
commit
9553aff679
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

+ 2 - 0
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -88,7 +88,9 @@ void platform_init()
     // Get flash chip size
     uint8_t cmd_read_jedec_id[4] = {0x9f, 0, 0, 0};
     uint8_t response_jedec[4] = {0};
+    __disable_irq();
     flash_do_cmd(cmd_read_jedec_id, response_jedec, 4);
+    __enable_irq();
     g_flash_chip_size = (1 << response_jedec[3]);
     log("Flash chip size: ", (int)(g_flash_chip_size / 1024), " kB");