Skip to content

Commit 45ce78a

Browse files
FRASTMkartben
authored andcommitted
samples: code_relocation_nocopy: update macro for flash size and address
In case of the st,stm32-qspi-nor compatible new property and node definitions will requires new macro to get the external NOR flash base address and size Add the config for running the sample on stm32l475 disco kit Signed-off-by: Francois Ramu <francois.ramu@st.com>
1 parent e35ac8f commit 45ce78a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
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

samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
/* On stm32 QSPI, external flash is mapped in XIP region at address given by the reg property. */
3838

3939
#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_SIZE(DT_INST(0, st_stm32_qspi_nor))
40+
#define EXTFLASH_ADDR DT_REG_ADDR_BY_IDX(DT_PARENT(EXTFLASH_NODE), 1)
41+
#define EXTFLASH_SIZE (DT_PROP(EXTFLASH_NODE, size) / 8)
4242

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

4646
#define EXTFLASH_NODE DT_INST(0, st_stm32_xspi_nor)
4747
#define EXTFLASH_ADDR DT_REG_ADDR_BY_IDX(DT_PARENT(EXTFLASH_NODE), 1)
48-
#define EXTFLASH_SIZE DT_PROP(EXTFLASH_NODE, size) / 8
48+
#define EXTFLASH_SIZE (DT_PROP(EXTFLASH_NODE, size) / 8)
4949

5050
#elif defined(CONFIG_FLASH_MSPI_NOR) && defined(CONFIG_SOC_NRF54H20_CPUAPP)
5151

0 commit comments

Comments
 (0)