Skip to content

Commit 2249b7e

Browse files
committed
samples: code relocation in external memory of stm32 disco kit
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]>
1 parent de6f1d9 commit 2249b7e

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_FLASH=y
2+
CONFIG_STM32_MEMMAP=y
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CONFIG_FLASH=y
2+
CONFIG_STM32_MEMMAP=y

samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
#define EXTFLASH_SIZE DT_PROP_OR(EXTFLASH_NODE, size_in_bytes, \
2727
DT_PROP(EXTFLASH_NODE, size) / 8)
2828

29+
#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_ospi_nor))
30+
/* On stm32 OSPI, external flash is mapped in XIP region at address given by the reg property. */
31+
32+
#define EXTFLASH_NODE DT_INST(0, st_stm32_ospi_nor)
33+
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor))
34+
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_ospi_nor), 1)
35+
36+
#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_qspi_nor))
37+
/* On stm32 QSPI, external flash is mapped in XIP region at address given by the reg property. */
38+
39+
#define EXTFLASH_NODE DT_INST(0, st_stm32_qspi_nor)
40+
#define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor))
41+
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_qspi_nor), 1)
42+
2943
#else
3044

3145
/*

0 commit comments

Comments
 (0)