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 <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2024-05-06 16:36:10 +02:00 committed by Carles Cufí
parent 0a89ce0bf5
commit c8cd57fe9e
1 changed files with 6 additions and 1 deletions

View File

@ -1283,7 +1283,12 @@ static int flash_stm32_qspi_init(const struct device *dev)
HAL_QSPI_Init(&dev_data->hqspi);
#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id)
#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id) && \
defined(QUADSPI_CR_FSEL)
/*
* Some stm32 mcu with quadspi (like stm32l47x or stm32l48x)
* does not support Dual-Flash Mode
*/
uint8_t qspi_flash_id = DT_PROP(DT_NODELABEL(quadspi), flash_id);
HAL_QSPI_SetFlashID(&dev_data->hqspi,