Skip to content

Commit 103f3b0

Browse files
FRASTMnashif
authored andcommitted
drivers: flash: stm32 qspi driver sends the reset cmd
Use the define to send the reset cmd at quad-flash init : SPI_NOR_CMD_RESET_EN followed by SPI_NOR_CMD_RESET_MEM when the st,stm32-qspi-nor has the <reset-cmd> property set. Reports the jedecID correctly. Signed-off-by: Francois Ramu <[email protected]>
1 parent f82b4ff commit 103f3b0

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/flash/flash_stm32_qspi.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#define STM32_QSPI_BASE_ADDRESS DT_INST_REG_ADDR(0)
3636

3737
#define STM32_QSPI_RESET_GPIO DT_INST_NODE_HAS_PROP(0, reset_gpios)
38-
#define STM32_QSPI_RESET_CMD DT_PROP(DT_NODELABEL(quadspi), set_cmd)
38+
#define STM32_QSPI_RESET_CMD DT_INST_PROP(0, reset_cmd)
3939

4040
#include <stm32_ll_dma.h>
4141

@@ -336,8 +336,10 @@ static int qspi_read_jedec_id(const struct device *dev, uint8_t *id)
336336
return -EIO;
337337
}
338338

339+
LOG_DBG("Read JESD216-ID");
340+
339341
dev_data->cmd_status = 0;
340-
id = &data[0];
342+
memcpy(id, data, JESD216_READ_ID_LEN);
341343

342344
return 0;
343345
}
@@ -1270,6 +1272,9 @@ static int flash_stm32_qspi_send_reset(const struct device *dev)
12701272
LOG_ERR("%d: Failed to send RESET_MEM", ret);
12711273
return ret;
12721274
}
1275+
1276+
LOG_DBG("Send Reset command");
1277+
12731278
return 0;
12741279
}
12751280
#endif

0 commit comments

Comments
 (0)