Skip to content

Commit c8cd57f

Browse files
FRASTMcarlescufi
authored andcommitted
drivers: flash: stm32 qspi driver when Dual-Flash not supported
Some stm32 devices with quadspi (like stm32l47x or stm32l48x) does not support Dual-Flash Mode. Avoid building error even if the &quadspi node has a <flash-id> property defined. Signed-off-by: Francois Ramu <[email protected]>
1 parent 0a89ce0 commit c8cd57f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/flash/flash_stm32_qspi.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,12 @@ static int flash_stm32_qspi_init(const struct device *dev)
12831283

12841284
HAL_QSPI_Init(&dev_data->hqspi);
12851285

1286-
#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id)
1286+
#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id) && \
1287+
defined(QUADSPI_CR_FSEL)
1288+
/*
1289+
* Some stm32 mcu with quadspi (like stm32l47x or stm32l48x)
1290+
* does not support Dual-Flash Mode
1291+
*/
12871292
uint8_t qspi_flash_id = DT_PROP(DT_NODELABEL(quadspi), flash_id);
12881293

12891294
HAL_QSPI_SetFlashID(&dev_data->hqspi,

0 commit comments

Comments
 (0)