Skip to content

Commit 1bbffc5

Browse files
committed
fix(spi_flash): Fix spi flash qio/dio read failed on gpspi flash
1 parent 4016917 commit 1bbffc5

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

components/hal/spi_flash_hal_common.inc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ esp_err_t spi_flash_hal_configure_host_io_mode(
126126
* - DIO is similar.
127127
*/
128128
if (conf_required) {
129-
#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL
130129
int line_width = (io_mode == SPI_FLASH_DIO? 2: 4);
131130
dummy_cyclelen_base -= SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS / line_width;
131+
#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL
132132
addr_bitlen += SPI_FLASH_LL_CONTINUOUS_MODE_BIT_NUMS;
133133
#endif
134134
spi_flash_ll_set_extra_address(dev, 0);
@@ -138,7 +138,9 @@ esp_err_t spi_flash_hal_configure_host_io_mode(
138138
}
139139
#endif
140140
#else
141-
gpspi_flash_ll_set_dummy_out(dev, (conf_required? 1: 0), 1);
141+
if (conf_required) {
142+
gpspi_flash_ll_set_dummy_out(dev, (conf_required? 1: 0), 1);
143+
}
142144
#endif
143145

144146
#if CONFIG_IDF_TARGET_ESP32P4

components/spi_flash/include/spi_flash/spi_flash_defs.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,8 @@
5757

5858
#define CMD_RDSFDP 0x5A /* Read the SFDP of the flash */
5959

60-
#if !SOC_SPI_MEM_SUPPORT_WB_MODE_INDEPENDENT_CONTROL
6160
#define SPI_FLASH_DIO_DUMMY_BITLEN 4
6261
#define SPI_FLASH_QIO_DUMMY_BITLEN 6
63-
#else
64-
#define SPI_FLASH_DIO_DUMMY_BITLEN 0
65-
#define SPI_FLASH_QIO_DUMMY_BITLEN 4
66-
#endif
6762
#define SPI_FLASH_DIO_ADDR_BITLEN 24
6863
#define SPI_FLASH_QIO_ADDR_BITLEN 24
6964
#define SPI_FLASH_QOUT_ADDR_BITLEN 24

0 commit comments

Comments
 (0)