From 01684df03a9f39199296b61e7b9074fe166591bd Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 19 Mar 2024 14:22:18 +0100 Subject: [PATCH] drivers: flash: stm32 ospi flash driver the correct erase instruction Use the most adapted instruction for the sector erase command It can be 0x20 or ox21 or 0x21DE in octo - DTR mode. The value is given by the SFDP table and filled in the erase_types table the during the SFDP discovery process. Signed-off-by: Francois Ramu --- drivers/flash/flash_stm32_ospi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/flash/flash_stm32_ospi.c b/drivers/flash/flash_stm32_ospi.c index 030dc8bd156..fa9df2937e7 100644 --- a/drivers/flash/flash_stm32_ospi.c +++ b/drivers/flash/flash_stm32_ospi.c @@ -1108,11 +1108,11 @@ static int flash_stm32_ospi_erase(const struct device *dev, off_t addr, ? SPI_NOR_CMD_SE_4B : SPI_NOR_CMD_SE; } - /* Avoid using wrong erase type, - * if zero entries are found in erase_types - */ - bet = NULL; } + /* Avoid using wrong erase type, + * if zero entries are found in erase_types + */ + bet = NULL; } LOG_DBG("Sector/Block Erase addr 0x%x, asize 0x%x amode 0x%x instr 0x%x", cmd_erase.Address, cmd_erase.AddressSize,