Skip to content

Commit 47c4565

Browse files
committed
boot: zephyr: defines FLASH device for external NOR
With CONFIG_STM32_MEMMAP flag get NOR flash 32 bytes header Read the NOR flash to get header of the image. The FLASH_DEVICE is now given by the parent of the "st,stm32-xspi-nor" node, which is the "st,stm32-xspi" compatible same for qspi/ospi instances of stm32 devices. Signed-off-by: Francois Ramu <[email protected]>
1 parent 07222c1 commit 47c4565

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

boot/zephyr/flash_map_extended.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ BOOT_LOG_MODULE_DECLARE(mcuboot);
2626
#if DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_xspi_nor), okay)
2727
#define DT_DRV_COMPAT st_stm32_xspi_nor
2828
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_xspi_nor)
29-
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_INST_PARENT(0), 1)
29+
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_PARENT(FLASH_DEVICE_NODE),1)
3030
#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_ospi_nor), okay)
31+
#define DT_DRV_COMPAT st_stm32_ospi_nor
3132
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_ospi_nor)
32-
#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_ospi_nor))
33+
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_PARENT(FLASH_DEVICE_NODE),1)
3334
#elif DT_NODE_HAS_STATUS(DT_INST(0, st_stm32_qspi_nor), okay)
35+
#define DT_DRV_COMPAT st_stm32_qspi_nor
3436
#define FLASH_DEVICE_NODE DT_INST(0, st_stm32_qspi_nor)
35-
#define FLASH_DEVICE_BASE DT_REG_ADDR(DT_INST(0, st_stm32_qspi_nor))
37+
#define FLASH_DEVICE_BASE DT_REG_ADDR_BY_IDX(DT_PARENT(FLASH_DEVICE_NODE),1)
3638
#else
3739
#error "FLASH_DEVICE_NODE could not be determined"
3840
#endif

0 commit comments

Comments
 (0)