From f06b0df90c5f778f89c0b4551464e86ea9e27f40 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Thu, 20 Jun 2024 15:25:59 +0200 Subject: [PATCH] samples: drivers: configure the sample to run on stm32h573_dk Declare the stm32h573i_dk node to be MSPI compatible when running the samples/drivers/jesd216 or samples/drivers/mspi/ Only SPI/STR mode. No DMA in this version. Signed-off-by: Francois Ramu --- .../drivers/mspi/mspi_flash/CMakeLists.txt | 4 +++ .../mspi/mspi_flash/boards/stm32h573i_dk.conf | 9 +++++ .../mspi_flash/boards/stm32h573i_dk.overlay | 34 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.conf create mode 100644 samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay diff --git a/samples/drivers/mspi/mspi_flash/CMakeLists.txt b/samples/drivers/mspi/mspi_flash/CMakeLists.txt index efeab2b862d1276..c6ff347628ea009 100644 --- a/samples/drivers/mspi/mspi_flash/CMakeLists.txt +++ b/samples/drivers/mspi/mspi_flash/CMakeLists.txt @@ -11,3 +11,7 @@ if(CONFIG_FLASH_MSPI_ATXP032) target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/zephyr/drivers) target_include_directories(app PRIVATE ${ZEPHYR_BASE}/drivers/mspi) endif() +if(CONFIG_FLASH_STM32_MSPI) + target_include_directories(app PRIVATE ${ZEPHYR_BASE}/include/zephyr/drivers) + target_include_directories(app PRIVATE ${ZEPHYR_BASE}/drivers/mspi) +endif() diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.conf b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.conf new file mode 100644 index 000000000000000..1f13da0de97c6ce --- /dev/null +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.conf @@ -0,0 +1,9 @@ +# Copyright (c) 2024 STMicroelectronics +# SPDX-License-Identifier: Apache-2.0 + + +CONFIG_LOG=y +CONFIG_FLASH_LOG_LEVEL_DBG=y +CONFIG_MSPI_LOG_LEVEL_DBG=y + +CONFIG_FLASH_MSPI_NOR_MX=y diff --git a/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay new file mode 100644 index 000000000000000..2bfba992cf80170 --- /dev/null +++ b/samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 STMicroelectronics + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/ { + aliases { + flash0 = &mx25lm51245; + }; +}; + +&mx25lm51245 { + /* First step : only SPI/STR supported */ + /delete-property/ mspi-io-mode; + /delete-property/ mspi-data-rate; + mspi-io-mode = "MSPI_IO_MODE_SINGLE"; + mspi-data-rate = "MSPI_DATA_RATE_SINGLE"; + /delete-property/ read-command; + read-command = <0x13>; /* Fast read */ + /delete-property/ address-length; + address-length = "ADDR_3_BYTE"; +}; + +&mspi1 { + /* request 57 for xSPI1 */ + dmas = <&gpdma1 4 57 STM32_DMA_PERIPH_TX + &gpdma1 5 57 STM32_DMA_PERIPH_RX>; + dma-names = "tx", "rx"; +}; + +&gpdma1 { + status = "disabled"; +};