From 4ce8b59016fba5ec2037c0ecdf000497e8a09203 Mon Sep 17 00:00:00 2001 From: Cao Sen Miao Date: Tue, 11 Aug 2020 11:57:33 +0800 Subject: [PATCH] spi_flash: fix initialization failure when ex_flash with psram on non-SPI1 bus. Close https://github.com/espressif/esp-idf/issues/4379 --- components/hal/spi_flash_hal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/hal/spi_flash_hal.c b/components/hal/spi_flash_hal.c index cc21f54bbe..6e881daa6f 100644 --- a/components/hal/spi_flash_hal.c +++ b/components/hal/spi_flash_hal.c @@ -66,7 +66,7 @@ static inline int get_dummy_n(bool gpio_is_used, int input_delay_ns, int eff_clk esp_err_t spi_flash_hal_init(spi_flash_hal_context_t *data_out, const spi_flash_hal_config_t *cfg) { - if (!esp_ptr_internal(data_out)) { + if (!esp_ptr_internal(data_out) && cfg->host_id == SPI1_HOST) { return ESP_ERR_INVALID_ARG; } if (cfg->cs_num >= SOC_SPI_PERIPH_CS_NUM(cfg->host_id)) {