Skip to content

Commit 0e1ffc7

Browse files
djiatsaf-stkartben
authored andcommitted
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 <[email protected]>
1 parent c77587a commit 0e1ffc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

samples/application_development/code_relocation_nocopy/linker_arm_nocopy.ld

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,21 @@
3131

3232
#define EXTFLASH_NODE DT_INST(0, st_stm32_ospi_nor)
3333
#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)
34+
#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor))
3535

3636
#elif defined(CONFIG_STM32_MEMMAP) && DT_NODE_EXISTS(DT_INST(0, st_stm32_qspi_nor))
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)
4040
#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)
41+
#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor))
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(DT_INST(0, st_stm32_xspi_nor))
48-
#define EXTFLASH_SIZE DT_REG_ADDR_BY_IDX(DT_INST(0, st_stm32_xspi_nor), 1)
48+
#define EXTFLASH_SIZE DT_REG_SIZE(DT_INST(0, st_stm32_ospi_nor))
4949

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

0 commit comments

Comments
 (0)