esp_flash: fix cache exception when CS pin is through IOMUX

This commit is contained in:
Michael (XIAO Xufeng) 2020-04-08 00:42:46 +08:00
parent 11501dbaa9
commit 5404e3d434
2 changed files with 8 additions and 0 deletions

View file

@ -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 {

View file

@ -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)