Skip to content

Commit

Permalink
samples: code relocation in external memory of stm32 disco kit
Browse files Browse the repository at this point in the history
Define the configuration to run the code_relocation
application on the external memory octo flash
of the stm32u585 or stm32h7b3i disco kit in XIP

Signed-off-by: Francois Ramu <[email protected]>
  • Loading branch information
FRASTM committed Mar 29, 2024
1 parent de6f1d9 commit 2249b7e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_FLASH=y
CONFIG_STM32_MEMMAP=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_FLASH=y
CONFIG_STM32_MEMMAP=y
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
#define EXTFLASH_SIZE DT_PROP_OR(EXTFLASH_NODE, size_in_bytes, \
DT_PROP(EXTFLASH_NODE, size) / 8)

#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_ospi_nor))
/* On stm32 OSPI, external flash is mapped in XIP region at address given by the reg property. */

#define EXTFLASH_NODE DT_INST(0, st_stm32_ospi_nor)
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor))
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_ospi_nor), 1)

#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_qspi_nor))
/* On stm32 QSPI, external flash is mapped in XIP region at address given by the reg property. */

#define EXTFLASH_NODE DT_INST(0, st_stm32_qspi_nor)
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor))
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_qspi_nor), 1)

#else

/*
Expand Down

0 comments on commit 2249b7e

Please sign in to comment.