diff --git a/core/flash/spi_flash.c b/core/flash/spi_flash.c index e27906cd..bd27b7c3 100644 --- a/core/flash/spi_flash.c +++ b/core/flash/spi_flash.c @@ -192,7 +192,7 @@ static int spi_flash_configure_device (const struct spi_flash *flash, bool wake_ if (reset_device) { status = spi_flash_reset_device (flash); - if (status != 0) { + if ((status != 0) && (status != SPI_FLASH_RESET_NOT_SUPPORTED)) { goto exit; } } diff --git a/core/flash/spi_flash_sfdp.c b/core/flash/spi_flash_sfdp.c index a8b23b8e..69fbd62b 100644 --- a/core/flash/spi_flash_sfdp.c +++ b/core/flash/spi_flash_sfdp.c @@ -601,7 +601,13 @@ int spi_flash_sfdp_get_4byte_mode_switch (const struct spi_flash_sfdp_basic_tabl params = (struct spi_flash_sfdp_basic_parameter_table_1_5*) table->data; if (table->sfdp->sfdp_header.parameter0.minor_revision >= 5) { - if ((params->enter_4b & 0x7f) == 0) { + + // 4 bytes only flash, no switch command available: + if ((params->table_1_0.dspi_qspi & SPI_FLASH_SFDP_ADDRESS_BYTES) == + SPI_FLASH_SFDP_4BYTE_ONLY) { + *addr_4byte = SPI_FLASH_SFDP_4BYTE_MODE_FIXED; + } + else if ((params->enter_4b & 0x7f) == 0) { *addr_4byte = SPI_FLASH_SFDP_4BYTE_MODE_UNSUPPORTED; } else if ((params->enter_4b & SPI_FLASH_SFDP_4B_ENTER_B7) &&