Explorar o código

esp_flash: fix cache exception when CS pin is through IOMUX

Michael (XIAO Xufeng) %!s(int64=5) %!d(string=hai) anos
pai
achega
5404e3d434

+ 2 - 0
components/spi_flash/esp_flash_spi_init.c

@@ -88,6 +88,8 @@ static IRAM_ATTR NOINLINE_ATTR void cs_initialize(esp_flash_t *chip, const esp_f
     //initialization, disable the cache temporarily
     chip->os_func->start(chip->os_func_data);
     if (use_iomux) {
+        // This requires `gpio_iomux_in` and `gpio_iomux_out` to be in the IRAM.
+        // `linker.lf` is used fulfill this requirement.
         gpio_iomux_in(cs_io_num, spics_in);
         gpio_iomux_out(cs_io_num, spics_func, false);
     } else {

+ 6 - 0
components/spi_flash/linker.lf

@@ -8,3 +8,9 @@ entries:
     spi_flash_chip_gd(noflash)
     memspi_host_driver (noflash)
 
+# `spi_bus_add_flash_device` uses these functions when the cache is disabled
+[mapping:driver_spiflash]
+archive: libdriver.a
+entries:
+    gpio:gpio_iomux_out (noflash)
+    gpio:gpio_iomux_in (noflash)