From e9af3c57201160c5254e5068bb6f508e45b6352d Mon Sep 17 00:00:00 2001 From: Fabrice DJIATSA Date: Fri, 21 Mar 2025 11:36:52 +0100 Subject: [PATCH] samples: code_relocation_nocopy: update macro to get flash size The flash size is the second part (size) of the first reg value, not the first part (address) of a nonexistent second reg value. DT_REG_SIZE get a node's (only) register block size instead DT_REG_ADDR_BY_IDX . Signed-off-by: Fabrice DJIATSA --- .../code_relocation_nocopy/linker_arm_nocopy.ld | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld b/samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld index 0a11783cca2ae..5e69fabab0d8e 100644 --- a/samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld +++ b/samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld @@ -31,21 +31,21 @@ #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) +#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor)) #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) +#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor)) #elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_xspi_nor)) /* On stm32 XSPI, external flash is mapped in XIP region at address given by the reg property. */ #define EXTFLASH_NODE DT_INST(0, st_stm32_xspi_nor) #define EXTFLASH_ADDR DT_REG_ADDR(DT_INST(0, st_stm32_xspi_nor)) -#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_xspi_nor), 1) +#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor)) #elif defined(CONFIG_FLASH_MSPI_NOR) && defined(CONFIG_SOC_NRF54H20_CPUAPP)