Skip to content

Commit

Permalink
samples: drivers: configure the sample to run on stm32h573_dk
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
FRASTM committed Sep 12, 2024
1 parent f5a2e2f commit 6dd0042
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
4 changes: 4 additions & 0 deletions samples/drivers/mspi/mspi_flash/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
9 changes: 9 additions & 0 deletions samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.conf
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions samples/drivers/mspi/mspi_flash/boards/stm32h573i_dk.overlay
Original file line number Diff line number Diff line change
@@ -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";
};
2 changes: 1 addition & 1 deletion samples/drivers/mspi/mspi_flash/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <stdio.h>
#include <string.h>

#define SPI_FLASH_TEST_REGION_OFFSET 0xff000
#define SPI_FLASH_TEST_REGION_OFFSET 0x10000

#define SPI_FLASH_SECTOR_SIZE 4096

Expand Down

0 comments on commit 6dd0042

Please sign in to comment.